LchColor
Interface representing a color in the LCH color space.Properties
Lightness component (0-100)
Chroma component (0+, typically 0-150)
Hue component in degrees (0-360)
Optional alpha channel (0-1)
rgbToLch
Converts an RGB color to an LCH color.Parameters
The RGB color to convert. Must have
red, green, and blue properties (0-255), and an optional alpha property (0-1).Returns
An LCH color object with
l (lightness), c (chroma), h (hue), and optional alpha properties.Example
lchToRgb
Converts an LCH color to an RGB color.Parameters
The LCH color to convert. Must have
l (lightness), c (chroma), and h (hue) properties, and an optional alpha property.Returns
An RGB color object with
red, green, blue, and optional alpha properties.Example
labToLch
Converts a LAB color to an LCH color.Parameters
The LAB color to convert. Must have
l, a, and b properties, and an optional alpha property.Returns
An LCH color object with
l (lightness), c (chroma), h (hue), and optional alpha properties.Example
lchToLab
Converts an LCH color to a LAB color.Parameters
The LCH color to convert. Must have
l (lightness), c (chroma), and h (hue) properties, and an optional alpha property.Returns
A LAB color object with
l, a, b, and optional alpha properties.