The color string (e.g. "#ff0000", "rgb(255,0,0)").
Creates a new Color instance from RGB values.
Red component (0-255).
Green component (0-255).
Blue component (0-255).
Optionala: number
Alpha component (0-1).
Gets the alpha (transparency) value of the color.
The alpha value (0-1).
Checks if the color is invalid (e.g. failed parsing).
True if the color is invalid, false otherwise.
Lightens the color by a given percentage.
The percentage to lighten (0-100).
The current Color instance.
Sets the alpha (transparency) value of the color.
The new alpha value (0-1).
The current Color instance.
Sets the color using HSV (Hue, Saturation, Value) components.
Hue (0-1).
Saturation (0-1).
Value (0-1).
Alpha (0-1, default 1.0).
The current Color instance.
Sets the color using RGB (Red, Green, Blue) components.
Red component (0-255).
Green component (0-255).
Blue component (0-255).
Alpha component (0-1).
The current Color instance.
accepts: #aaa #ababab #ababab55 rgb(a,b,c) rgba(a,b,c,d) var( --color-5 ) cyan transparent
Returns the Hex string representation of the color.
The hex color string (e.g. "#ff0000" or "#ff000080").
Converts the color to HSV representation.
An object containing hue, saturation, value, and alpha properties.
return the number value of the color (no transparency)
Returns the color as an RGB object.
An object containing red, green, blue, and alpha properties.
Returns the CSS string representation of the color.
OptionalwithAlpha: boolean
Whether to include the alpha channel (default: true if alpha < 1).
The CSS color string (e.g. "rgb(255,0,0)" or "rgba(255,0,0,0.5)").
Creates a new Color instance from a string.