Color

The Color class represents an RGB color value. Color instances are immutable. The constructors are accessible from scripts.

Fields

Methods

init( r, g, b )

Constructs a new Color instance with the given red, green and blue values (in the range 0.0 to 1.0) and an alpha of 1.0.

init( r, g, b, a )

Constructs a new Color instance with the given red, green, blue and alpha values (in the range 0.0 to 1.0).

init( name )

Constructs a new Color instance derived from standard HTML color hex value or color name; e.g., “#FF0000”, “white”, “black”, “orange”, etc. See Online Resources for a link to a complete list.

equals( object )

Returns True if object represents the same color as self within a set tolerance.

Pre-defined colors

These are class variables of Color. Note that some are not a match for the HTML color name equivalent; e.g., ORANGE is the not the same color as HTML “orange”.

Last updated