The RGB class holds a single color value and allows for easy modification and reading of it, with optional on-change callback notification and a dirty flag.
new RGB([red], [green], [blue])
name | type | arguments | description |
---|---|---|---|
red | number | <optional> |
The red color value. A number between 0 and 1. |
green | number | <optional> |
The green color value. A number between 0 and 1. |
blue | number | <optional> |
The blue color value. A number between 0 and 1. |
The blue color value. Between 0 and 1.
Changing this property will flag this RGB object as being dirty
and invoke the onChangeCallback
, if set.
Is this color dirty?
The green color value. Between 0 and 1.
Changing this property will flag this RGB object as being dirty
and invoke the onChangeCallback
, if set.
This callback will be invoked each time one of the RGB color values change.
The callback is sent the new color values as the parameters.
The red color value. Between 0 and 1.
Changing this property will flag this RGB object as being dirty
and invoke the onChangeCallback
, if set.
Nulls any external references this object contains.
Compares the given rgb parameters with those in this object and returns
a boolean true
value if they are equal, otherwise it returns false
.
name | type | description |
---|---|---|
red | number |
The red value to compare with this object. |
green | number |
The green value to compare with this object. |
blue | number |
The blue value to compare with this object. |
true
if the given values match those in this object, otherwise false
.
Internal on change handler. Sets this object as being dirty and
then invokes the onChangeCallback
, if set, passing in the
new RGB values.
Sets the red, green and blue values of this RGB object, flags it as being
dirty and then invokes the onChangeCallback
, if set.
name | type | arguments | description |
---|---|---|---|
red | number | <optional> |
The red color value. A number between 0 and 1. |
green | number | <optional> |
The green color value. A number between 0 and 1. |
blue | number | <optional> |
The blue color value. A number between 0 and 1. |
This RGB instance.