Initializes a Color instance with optional color value
Optionalcolor: number | ColorStringOptional color value
- String format: Supports CSS color formats (e.g., rgba(255,0,0,0.5), #FF0000, transparent)
- Number format: Supports hexadecimal color value (e.g., 0xFF0000 for red)
- No parameter: Defaults to opaque black (r=0, g=0, b=0, a=1)
Alpha/opacity component (0-1)
Blue component (0-1)
Green component (0-1)
Red component (0-1)
Creates a new Color instance with the same RGBA values
New Color instance with identical values
Copies RGBA values from another color
Color instance to copy values from
Current Color instance for chaining
Checks if this color equals another color
Color instance to compare with
True if colors are identical, false otherwise
Gets the color as a hexadecimal number
Hexadecimal representation of the color
Gets the color as a hexadecimal string without the hash prefix
Hexadecimal string representation of the color (e.g., "FF0000" for red)
Gets the color as an RGBA CSS string
CSS rgba() string representation of the color
Sets the RGBA values of the color
Red component (range: 0-1)
Green component (range: 0-1)
Blue component (range: 0-1)
Alpha/opacity component (range: 0-1)
Current Color instance for chaining
Sets color from a hexadecimal number
Hexadecimal color value (e.g., 0xFF0000 for red)
Current Color instance for chaining
Sets color from a CSS color string
CSS color string in formats like 'red' 'yellow' and so on, 'rgb()', 'rgba()', '#RRGGBB', '#RGB', or 'transparent'
Current Color instance for chaining
Converts the color to an array of RGBA values
Array containing [r, g, b, a] components
Color Class for color manipulation and conversion