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.
This individual color expressed in all the supported color formats.
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 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.
Protected
pullUpdate 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.
Protected
setConverts 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.
Static
deserializeCreate a new Color instance by parsing the output of another instance's Color.serialize method.
A
Color
class with state and the following features:'none'
, they stay at their previous value. This makes for a much smoother UI experience.