Class Color

A simple container for a color, mainly used to convert from css format to numbers and vice-versa

Source : file controls/colorControl/Color.js at line 33

Constructor

new Color ( red, green, blue )

The constructor

Source : file controls/colorControl/Color.js at line 63

Parameters

Name Type Description
red null or Number

The red value of the color. Must be between 0 and 255. If null set to 255

green null or Number

The green value of the color. Must be between 0 and 255. If null set to 255

blue null or Number

The blue value of the color. Must be between 0 and 255. If null set to 255

Public getters and setters

get blue : Number

The blue value of the color

Source : file controls/colorControl/Color.js at line 144

set blue

Source : file controls/colorControl/Color.js at line 146

get cssColor : String

The color in the css HEX format '#RRGGBB' or 'rgb( )'

Source : file controls/colorControl/Color.js at line 157

set cssColor

Source : file controls/colorControl/Color.js at line 164

get green : Number

The green value of the color

Source : file controls/colorControl/Color.js at line 131

set green

Source : file controls/colorControl/Color.js at line 133

readonly static get MAX_COLOR : Number

The bigest acceptable value fo a color

Source : file controls/colorControl/Color.js at line 99

readonly static get MIN_COLOR : Number

The smallest acceptable value fo a color

Source : file controls/colorControl/Color.js at line 91

get red : Number

The red value of the color

Source : file controls/colorControl/Color.js at line 118

set red

Source : file controls/colorControl/Color.js at line 120

Public methods

static fromCss ( cssColor )

A static method that build a Color object from a css color string

Source : file controls/colorControl/Color.js at line 107

Parameters

Name Type Description
cssColor String

The css color string

Returns

A new color object set to the color in the css string
Type : Color

Private properties

#blue : Number

The blue value of the color

Source : file controls/colorControl/Color.js at line 54

#green : Number

The green value of the color

Source : file controls/colorControl/Color.js at line 47

#red : Number

The red value of the color

Source : file controls/colorControl/Color.js at line 40