Color in Anark Studio 2.5

An RGBA color.

Inherits from:

Instance Properties

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

Instance Methods

name returns description
toLocaleString() String For most objects, the same as toString() unless explicitly overridden. [from Object]
valueOf() String Returns the internal this value of the object. [from Object]
hasOwnProperty() Boolean Determines if the object/instance itself has the named property or method. [from Object]
isPrototypeOf() Boolean Determines if the calling object prototype is in the inheritance chain for the supplied argument. [from Object]
propertyIsEnumerable() 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]
copy() Color Duplicate the color object.
add() (none) Add two colors.
subtract() (none) Subtract two colors.
blend() (none) Blend two colors.
negative() (none) Negate the color.
contrast() (none) Increase/decrease contrast of the color.
scale() (none) Scale the color.
saturation() (none) Change the saturation of the color.
linear() (none) Move the color towards another color.
equals() Boolean Compare two colors for equivalence.
toString() String Returns a string representation 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
backgroundColor Scene The background color for the scene.
specular Material Specularity color.
diffuse Material Diffuse color.
ambient Material Ambient color.
color Layer Background color for the layer.
fogColor Camera Color of the fog.
specular Light Highlight color.
diffuse Light Light color.
ambient Light Ambient scene 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() Color The color to add to the curren
otherColor subtract() Color The color to subtract from the
otherColor blend() Color The color to blend with the cu
targetColor linear() Color The color to weight towards.
otherColor equals() Color The color to compare to.