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].
Checks if this color is equal to another.
The color to compare with.
True if the colors are equal, otherwise false.
Linearly interpolates between this color and the given one.
The color to interpolate with.
The interpolation factor, with alpha = 0 being this color, and alpha = 1 being the given one.
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
Optional
argb: boolean = falsetrue if format is #ARGB, or #AARRGGBB (as opposed to #RGBA or #RGGBBAA)
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].
Optional
alpha: 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].
Optional
alpha: number = 1.0The alpha value [0.0 .. 1.0]. Defaults to 1.
Reference to this object for method chaining.
A color manipulation object.