Colour

Oklab and OkLCh

Widely availablesince Nov 2025

Replaces: HSL, whose "lightness" is not the lightness an eye sees. Equal steps in OKLCH look like equal steps, so a tint ramp does not go muddy in the middle.

See it working

hsl, lightness 50%
oklch, lightness 0.7

The syntax

--brand-500: oklch(0.55 0.22 275);
--brand-300: oklch(0.75 0.22 275);   /* same hue and chroma, lighter */
Edit the demo’s CSS

This is the stylesheet running the demo above. Change a value and watch it. Break it on purpose: delete the modern line and you are looking at the fallback.

For browsers without it

For older browsers declare a hex first and the oklch() value on the next line: an engine that cannot parse the second keeps the first.