CSS lch() Function

The CSS lch() function defines a color in the CIELAB color space using cylindrical coordinates: Lightness, Chroma, and Hue.

Introduced in CSS Color Module Level 4, lch() shares the exact same perceptually uniform color space as the lab() function, but represents colors using a familiar wheel-based model (similar to HSL) that is far more intuitive for developers and designers to pick and manipulate.

Syntax

The lch() function accepts three space-separated values representing Lightness, Chroma, and Hue, plus an optional alpha transparency channel:

Parameters

Basic Examples

Here are some basic color examples specified using lch():

Using lch() in Style Sheets

The CSS specifications state that you can use lch() wherever a CSS <color> value is accepted. For example, you can use lch() to set the colors of text, backgrounds, and borders:

Specifying Transparency

An alpha channel can be added after a forward slash (/) to create semi-transparent colors:

lch() vs hsl()

While lch() and hsl() look similar because they both use Lightness and Hue, lch() solves major flaws found in hsl():

Feature hsl() lch()
Perceptual Lightness Flawed: Yellow and blue both have 50% lightness, but yellow looks far brighter. Uniform: 50% lightness in LCH has the exact same perceived brightness across every hue.
Color Gamut Restricted to the 1990s sRGB color gamut. Wide-gamut: Can display high-saturation colors on modern P3 displays.
Color Saturation/Chroma Saturation is a percentage of sRGB gamut edge (varies wildly in intensity per hue). Chroma is an absolute measure of perceived color purity.

lch() vs lab()

lch() and lab() use the exact same underlying CIELAB color space. The only difference is how the color coordinates are described:

Related Color Functions