Skip to content
BENIBIX Learn

OKLCH Color

Also known as OKLCH, oklch(), Oklab

A way to write a color with three numbers that match how the eye sees.

Think of it like

It is like a ruler where each step looks the same size.

Example

Ana makes ten shades of blue for a design system. In OKLCH she changes only the lightness, and each step looks evenly lighter.

Why it matters

With HSL, two colors at the same lightness can look very different. OKLCH keeps lightness steady, which helps with contrast.

Definition

OKLCH is a way of writing a color with three numbers: lightness, chroma and hue. Lightness is how light it looks, chroma is how strong the color is, and hue is the angle on the color wheel. It is built so that equal steps in the numbers look like equal steps to the eye. CSS can use it with the oklch() function. Designers use it to make even color scales.

Example code

css
.button {
  background: oklch(65% 0.15 270);
}
This sets a blue button: 65 percent lightness, a medium chroma and a hue of 270 degrees.
OKLCH sets a color with three sliders: lightness, chroma and hue.

Common mistake

Pushing chroma too high. Some strong colors cannot be shown on most screens, and the browser pulls them back.

Key takeaways

  1. 1
    Three numbers. Lightness, chroma, hue.
  2. 2
    Even to the eye. Equal steps look equal.
  3. 3
    Built into CSS. The oklch() function.

Learn it properly