OKLCH is a cylindrical way to describe color using perceptual lightness (L), chroma (C) and hue (H). It is based on Oklab, a color space designed so similar numerical changes more closely resemble similar visual changes.

.button {
  background: oklch(62% 0.18 305);
  color: oklch(98% 0.01 305);
}

The three coordinates

CoordinateTypical CSS formWhat it controls
L — lightness0% to 100%Perceived dark-to-light position.
C — chroma0 upwardDistance from neutral gray. The usable maximum depends on L, H and gamut.
H — hue0deg to 360degPosition around the hue circle. Angles wrap.
Alpha0 to 1 after “/”Opacity; it is not part of the underlying color coordinates.

Why OKLCH ramps differ from HSL ramps

HSL lightness is a transform of encoded RGB channels, not a perceptually uniform measure. Setting several HSL colors to the same lightness can still produce visibly unequal brightness. In OKLCH, holding L while changing H is usually a more controlled experiment.

A useful mental model

LHierarchy: dark and light
CIntensity: neutral to vivid
HFamily: angle around the wheel

“More uniform” does not mean perfectly uniform for every observer, display or viewing condition. It means the coordinates are better aligned with visual differences than common device-oriented models such as RGB and HSL.

OKLCH in CSS

MDN marks OKLCH as widely available across modern browsers. A resilient token can still place a HEX fallback before the OKLCH declaration:

:root {
  --brand: #7651bd;
  --brand: oklch(58% 0.17 305);
}

OKLCH is not a gamut

OKLCH can describe coordinates that do not fit sRGB or Display P3. A production tool therefore needs both a color model and a delivery target. The W3C CSS Color specification describes reducing chroma while preserving lightness and hue as part of perceptual gamut mapping. This generator exposes the target and reports the change as ΔEOK.

Build a first palette

  1. Choose a middle role color whose meaning is already clear.
  2. Create a ramp by varying lightness and shaping chroma away from the extremes.
  3. Map to the display gamut your product supports.
  4. Check foreground/background pairs rather than individual swatches.
  5. Export both raw values and semantic role names.

Learn by moving one coordinate.
The generator accepts OKLCH, HEX, HSL and RGB input.

Explore OKLCH

Sources and further reading

Technical claims are grounded in specifications and primary documentation. Product observations are dated snapshots from direct use.