Color in Anark Studio 2.5

An RGBA color.

Inherits from:

Instance Properties

name type description
a Number Alpha/Opacity
b Number Blue
constructor Object A reference to the constructor class for the current object instance. [from Object]
g Number Green
prototype Object The prototype for a class. [from Object]
r Number Red

Instance Methods

name returns description
add(otherColor) (none) Add two colors.
blend(otherColor) (none) Blend two colors.
contrast(contrastFactor) (none) Increase/decrease contrast of the color.
copy() Color Duplicate the color object.
equals(otherColor) Boolean Compare two colors for equivalence.
hasOwnProperty(propertyOrMethodName) Boolean Determines if the object/instance itself has the named property or method. [from Object]
isPrototypeOf(instanceToTest) Boolean Determines if the calling object prototype is in the inheritance chain for the supplied argument. [from Object]
linear(targetColor,weightFactor) (none) Move the color towards another color.
negative() (none) Negate the color.
propertyIsEnumerable(propertyOrMethodName) Boolean Determines if the object/instance itself has a property or method of the supplied name which will appear in a for (prop in obj) enumeration. [from Object]
saturation(saturationFactor) (none) Change the saturation of the color.
scale(scaleFactor) (none) Scale the color.
subtract(otherColor) (none) Subtract two colors.
toLocaleString() String For most objects, the same as toString() unless explicitly overridden. [from Object]
toString() String Returns a string representation of the object. [from Object]
valueOf() String Returns the internal this value of the object. [from Object]

Description

The Color object encapsulates a four-component true color.

Constructor syntax

var color = new Color( r, g, b, a);
r
required — The red component of the color, containing a value between 0 and 255.
g
required — The green component of the color, containing a value between 0 and 255.
b
required — The blue component of the color, containing a value between 0 and 255.
a
required — The alpha component of the color, containing a value between 0 and 255. This property is not used in some color contexts.

Properties that are a Color

name object description
ambient Material Ambient color.
ambient Light Ambient scene color.
backgroundColor Scene The background color for the scene.
color Layer Background color for the layer.
diffuse Material Diffuse color.
diffuse Light Light color.
fogColor Camera Color of the fog.
specular Light Highlight color.
specular Material Specularity color.

Methods that return a Color

name of object description
copy() Color Duplicate the color object.

Arguments that are a Color

name in method of object description
otherColor add(otherColor) Color The color to add to the curren
otherColor subtract(otherColor) Color The color to subtract from the
otherColor blend(otherColor) Color The color to blend with the cu
otherColor equals(otherColor) Color The color to compare to.
targetColor linear(targetColor,weightFactor) Color The color to weight towards.