Creates a new Color instance.
A Color object or the red component [0 .. 255]. Defaults to 0.
The green component [0 .. 255]. Defaults to 0.
The blue component [0 .. 255]. Defaults to 0.
The alpha value [0.0 .. 1.0]. Defaults to 1.
Gets the alpha component of the color.
The alpha component [0.0 .. 1.0].
Sets the alpha component of the color.
The alpha component [0.0 .. 1.0].
Gets the blue component of the color.
The blue component [0 .. 255].
Sets the blue component of the color.
The blue component [0 .. 255].
Gets the green component of the color.
The green component [0 .. 255].
Sets the green component of the color.
The green component [0 .. 255].
Gets the red component of the color.
The red component [0 .. 255].
Sets the red component of the color.
The red component [0 .. 255].
Darkens this color value by a given scale.
The scale to darken the color by [0 .. 1].
Reference to this object for method chaining.
Checks if this color is equal to another.
The color to compare with.
True if the colors are equal, otherwise false.
Lightens this color value by a given scale
The scale to lighten the color by [0 .. 1].
Reference to this object for method chaining.
Parse a CSS color name and set this color to the corresponding r,g,b values
The CSS color name
Reference to this object for method chaining
Parse a Hex color ("#RGB", "#RGBA" or "#RRGGBB", "#RRGGBBAA" format) and set this color to the corresponding r,g,b,a values
The Hex color string to parse
Optionalargb: boolean = falsetrue if format is #ARGB, or #AARRGGBB (as opposed to #RGBA or #RGGBBAA)
Reference to this object for method chaining
Parse an RGB or RGBA CSS color string
The RGB or RGBA color string to parse
Reference to this object for method chaining
Generate random r,g,b values for this color object
Optionalmin: number = 0minimum value for the random range
Optionalmax: number = 255maxmium value for the random range
Reference to this object for method chaining
Sets the color to the specified values.
The red component [0 .. 255].
The green component [0 .. 255].
The blue component [0 .. 255].
Optionalalpha: number = 1.0The alpha value [0.0 .. 1.0]. Defaults to 1.
Reference to this object for method chaining.
Sets the color to the specified normalized float values.
The red component [0.0 .. 1.0].
The green component [0.0 .. 1.0].
The blue component [0.0 .. 1.0].
Optionalalpha: number = 1.0The alpha value [0.0 .. 1.0]. Defaults to 1.
Reference to this object for method chaining.
Sets the color to the specified HSL values.
The hue [0 .. 1].
The saturation [0 .. 1].
The lightness [0 .. 1].
Reference to this object for method chaining.
Sets the color to the specified HSV values.
The hue [0 .. 1].
The saturation [0 .. 1].
The value [0 .. 1].
Reference to this object for method chaining.
return an Float Array representation of this object
A Float Array representation of this color
return the color in "#RRGGBB" format
The color in "#RRGGBB" format
Get the color in "#RRGGBBAA" format
The alpha value [0.0 .. 1.0] to use in the output string.
The color in "#RRGGBBAA" format
Get the color in "rgb(R,G,B)" format
The color in "rgb(R,G,B)" format
Get the color in "rgba(R,G,B,A)" format
Optionalalpha: number = ...alpha value [0.0 .. 1.0]
The color in "rgba(R,G,B,A)" format
Pack this color RGB components into a Uint32 ARGB representation
Optionalalpha: number = 1.0alpha value [0.0 .. 1.0]
A Uint32 ARGB representation of this color
A color manipulation object.