Any valid CSS color string or an object of color coordinate values.
Protected Readonly_All current color values. These are updated whenever Color.set is called.
ProtectedoriginalThe color syntax the this color was set with.
This individual color expressed in all the supported color formats.
The current color expressed as an RGB hex coordinates.
The current color expressed as an RGB hex string.
The current color expressed as its HSL coordinate values.
The current color expressed as its HWB coordinate values.
The current color expressed as its LAB coordinate values.
The current color expressed as its LCH coordinate values.
The current color expressed as a single CSS color name string. If there is no color name that matches the current color, this will be an empty string.
The current color expressed as hardcoded CSS color keywords. If no CSS color keywords match the current color, this array will be empty.
The current color expressed as its Oklab coordinate values.
The current color expressed as its Oklch coordinate values.
The current color expressed as its RGB coordinate values.
Get the closest named CSS color to this Color class instance's current color.
Get the distance from this Color class instance to the given CSS color string.
ProtectedpullUpdate all internally stored color format values (Color.allColors) from the updated internal color object.
Update the current color by setting a whole new color, a single coordinate in a single color format, or multiple coordinates in a single color format. This mutates the current Color instance.
ProtectedsetConverts the values for each supported color format in a CSS string that can be directly used in any modern CSS code.
Converts the values for each supported color format into a padded string for easy display purposes.
Converts the color class to a CSS string format in the color space and format that it was originally set with.
StaticdeserializeCreate a new Color instance by parsing the output of another instance's Color.serialize method.
StaticisStaticisChecks if the input string can be converted into a color.
A
Colorclass with state and the following features:'none', they stay at their previous value. This makes for a much smoother UI experience.