OKLCH

On this page 6

OKLCH is a perceptually uniform color model that describes a color with three values: lightness (L), chroma (C) and hue (H). It is the cylindrical form of the Oklab color space, and in color theory and digital design it is valued because equal numeric changes produce roughly equal visible changes, which older models such as HSL do not achieve.

OKLCH is supported in CSS through the oklch() function, and it can express colors beyond the sRGB gamut, including the wider Display P3 range of modern screens. Designers use it to build consistent palettes, accessible contrast scales and predictable color manipulations in design systems.

How OKLCH represents color

OKLCH describes color the way people tend to judge it: how light it is, how intense it is and which hue it has. It is derived from Oklab, a color space published in 2020 that was optimized so that distances between colors correspond closely to perceived differences. OKLCH converts Oklab’s rectangular a and b axes into polar coordinates, giving chroma as the distance from neutral gray and hue as an angle.

ComponentMeaningTypical range in CSS
Lightness (L)Perceived brightness from black to white0 to 1, or 0% to 100%
Chroma (C)Colorfulness relative to a neutral gray0 to about 0.37 for displayable colors
Hue (H)Angle on the color wheel0 to 360 degrees
The three OKLCH components

A CSS value such as oklch(0.65 0.15 250) therefore means a medium-light, moderately saturated blue. Unlike hexadecimal or RGB values, each number has a direct perceptual meaning, which makes OKLCH values readable and editable by hand.

Chroma has no fixed upper limit. The maximum chroma that a screen can show depends on hue and lightness: a yellow can reach high chroma only at high lightness, while a blue reaches its maximum at much lower lightness. This uneven boundary reflects the real shape of human color vision and of display gamuts.

OKLCH compared with HSL, RGB and other models

The main advantage of OKLCH over HSL is that its lightness channel is perceptually accurate. In HSL, pure yellow and pure blue share 50 percent lightness, yet yellow looks far brighter. In OKLCH, colors with the same L value look similarly light, which is essential for contrast and hierarchy.

ModelPerceptually uniformMain limitation
OKLCHLargely yesSome colors fall outside display gamuts and need mapping
HSLNoLightness and saturation do not match perception
RGB and hexNoValues describe device channels, not appearance
CIE LCHPartlyHue shifts in blues and purples when chroma changes
OklabLargely yesRectangular axes are less intuitive to edit
How OKLCH differs from common color models

CIE LCH, based on the older CIELAB space, offers a similar structure but suffers from hue drift: lowering the chroma of a blue in CIE LCH tends to push it toward purple. OKLCH reduces this problem, so a hue angle stays visually stable across lightness and chroma changes.

Using OKLCH in palettes and design systems

OKLCH is particularly useful for generating tonal scales. A designer can keep hue and chroma steady and step lightness in equal increments, producing a ramp of shades that look evenly spaced. The same lightness values can then be reused across all brand hues, so different colors share consistent visual weight.

TaskOKLCH approachBenefit
Tonal scaleFix hue and chroma, step L by 0.08 to 0.10Even-looking steps from light to dark
Hover and active statesLower L by about 0.05 to 0.10Predictable darkening without hue shift
Theme variantsRotate H while keeping L and CNew palettes with equal emphasis
Dark modeRemap L values, reduce C for large areasComfortable surfaces with stable hues
GradientsInterpolate in OKLCH or OklabFewer gray or muddy midpoints
Practical tasks and how OKLCH helps

OKLCH also supports accessibility work. Because lightness tracks perception, a fixed difference in L gives a reasonable first estimate of contrast between text and background. It does not replace a formal contrast check, however, because WCAG contrast ratios are calculated from relative luminance, not from OKLCH lightness.

Gamut limits and common pitfalls

The most important caution with OKLCH is gamut mapping. Many combinations of L, C and H describe colors that no sRGB or P3 screen can display. Browsers then map such colors into the available gamut, and the result may differ noticeably from what the designer intended.

  • Out-of-gamut values: high chroma at extreme lightness often cannot be displayed; check colors in a gamut-aware picker.
  • Uneven maximum chroma: keeping one chroma value across all hues may push some hues outside the gamut while others look dull.
  • Hue interpolation: gradients across distant hues can take the long way around the wheel unless the interpolation direction is set.
  • Tool support: older design tools and libraries may convert OKLCH silently to sRGB and clip the result.
  • Contrast assumptions: equal lightness steps do not guarantee WCAG compliance, so verify ratios numerically.

A sound practice is to define tokens in OKLCH, test them on both sRGB and P3 displays, and provide fallback values where older browsers are still relevant.

In plain words

OKLCH is a way of writing down a color using three easy ideas: how light it is, how strong it is and what hue it is. Older methods on computers used numbers that described screen channels, not what people actually see.

With OKLCH, the numbers behave the way your eyes do. If you make two colors equally light in OKLCH, they really look equally light. That makes it much easier to build a set of colors that feels balanced, a bit like tuning instruments so they all play at the same volume.

A real-world example

A product team maintaining a design system for a banking web app needs consistent status colors for success, warning, error and information messages. In the old HSL palette, the yellow warning looked much brighter than the blue information color, so warnings drew more attention than intended.

The team redefines every status color in OKLCH with the same lightness of 0.62 and a chroma of about 0.14, changing only the hue angle: 145 for green, 85 for amber, 25 for red and 250 for blue. It then builds ten-step scales for each hue with lightness values from 0.97 to 0.25 and checks every text-and-background pair against WCAG contrast ratios, adjusting two steps that fell short.

The result is a palette in which all four status colors carry equal visual weight, dark mode variants are generated by reusing the same lightness steps in reverse, and new brand colors can be added by choosing a single hue angle.