new Color(
r
?,g
?,b
?):Color
number
Red component.
number
Green component.
number
Blue component.
get b():
number
Returns blue component of color.
number
set b(
b
):void
Sets blue component of color. Value should be in [0, 1]
range.
number
Blue component.
void
Blue component.
get g():
number
Returns green component of color.
number
set g(
g
):void
Sets green component of color. Value should be in [0, 1]
range.
number
Green component.
void
Green component.
get r():
number
Returns red component of color.
number
set r(
r
):void
Sets red component of color. Value should be in [0, 1]
range.
number
Red component.
void
Red component.
clone():
Color
Creates new Color
with components same as this
.
copy(
other
):this
Copies components from another color.
Other color.
this
hex():
number
Returns the hexadecimal value of this color which represents RGB.
number
isEqual(
other
,tolerance
?):boolean
Returns true
if other
color components are equal to this
point components within provided tolerance (1e-5
by default). Returns false
otherwise.
Other color.
number
Components comparison tolerance;
boolean
setComponents(
r
?,g
?,b
?):this
Sets r
, g
and b
components of this
object. Values should be in [0, 1]
range.
number
Red component.
number
Green component.
number
Blue component.
this
setHex(
hex
):this
Sets color from hex value which represents RGB.
number
Hex value.
this
toJSON():
BaseRGB
Returns JSON representation of the color.
toString():
string
Returns string representation of the color.
string
static
fromRGB(rgb
):Color
Creates new Color
object from object implementing BaseRGB interface.
Object implementing BaseRGB interface.