Creates a new instance of the Color class.
Optional
r: number = 255The red component of the color. Must be a number between 0 and 255.
Optional
g: number = 255The green component of the color. Must be a number between 0 and 255.
Optional
b: number = 255The blue component of the color. Must be a number between 0 and 255.
Optional
a: number = 1The alpha component of the color. Must be a number between 0 and 1.
Optional
onChange: Function = undefinedThe callback function to be called when the color changes.
Returns the hexadecimal representation of the RGB color.
The hexadecimal color value.
Returns an array containing the RGB values of the color.
An array of numbers representing the RGB values in the format [r, g, b].
Get the RGBA values of the color.
An array containing the red, green, blue, and alpha values.
Returns the normalized RGBA values as an array.
The normalized rgba values.
Returns the normalized RGB values as an array.
An array containing the normalized RGB values.
Sets the color of the object using a hexadecimal color code.
The hexadecimal color code to set the color with.
Sets the color of the object based on the provided RGB values.
The red value in the range of 0-255.
The green value in the range of 0-255.
The blue value in the range of 0-255.
Sets the color of the object using RGBA values.
The red component of the color. Value should be between 0 and 255.
The green component of the color. Value should be between 0 and 255.
The blue component of the color. Value should be between 0 and 255.
The alpha component of the color. Value should be between 0 and 1.
Represents a color with red, green, blue, and alpha values. Extends the ColorRGB class.