OKLab Explained: The Modern Perceptual Color Space

Guide · Updated 2026-07-28 · Yexla Team

In 2020 Björn Ottosson published OKLab — a color space with CIELAB's shape (L, a, b opponent axes) but numerically optimized against modern perception data. The name means what it says: it's LAB, but OK. Its two killer improvements: hue linearity (darkening a blue keeps it blue instead of drifting purple) and better lightness prediction. Within three years it was in the CSS specification and every major browser.

Where OKLab shines

Gradients and mixing: interpolating in OKLab avoids the gray "dead zone" that sRGB gradients produce between complementary colors — color-mix(in oklab, …) and linear-gradient(in oklab, …) give clean, even transitions. Programmatic manipulation: lighten/darken operations preserve hue. Uniform scales: steps of equal ΔL genuinely look equal.

ChannelRange (sRGB)Meaning
L0–1Perceived lightness
a≈ −0.23 to +0.28Green ↔ red
b≈ −0.31 to +0.20Blue ↔ yellow

OKLab in practice

.smooth { background: linear-gradient(in oklab, #6C5CE7, #00B8D9); }
.mixed  { color: color-mix(in oklab, red 40%, blue); }

For hand-editing, use its polar twin OKLCH. Convert anything with RGB to OKLAB and OKLAB to RGB.

Frequently asked questions

Who created OKLab?

Björn Ottosson, in 2020 — published as an open blog post with reference code, which accelerated its adoption into CSS.

What problem does OKLab solve?

CIELAB's hue bending (especially blues turning purple when darkened) and sRGB's muddy gradient interpolation.

Should gradients use OKLab?

Usually yes — in oklab interpolation avoids gray dead zones and hue drift. It's one CSS keyword away.