OKLab: Oklab Perceptual Cartesian Color Space
Cartesian sister space to OKLCH using perceptual Lightness (L) and opponent axes a (green-red) and b (blue-yellow) for straight-line blending.
| Extension / Token | .css |
|---|---|
| MIME / Media type | text/css |
| Gamut scope | Wide Gamut (P3 / Unbounded) |
| Human readability | Medium |
| Perceptual uniformity | Yes |
| Alpha channel support | Yes |
| Best for | Smooth CSS gradients without gray dead zones, color mixing, and image shaders |
OKLab
CSSoklab(54.6% -0.025 -0.214)Strengths
- Straight-line interpolation in OKLab yields vibrant, artifact-free gradients without hue snapping.
- Default recommended space for CSS color-mix(in oklab, ...) and linear-gradient(in oklab, ...).
- Eliminates the notorious CIELab blue-shift towards purple.
Trade-offs
- Opponent axes (a, b) are harder to read intuitively by eye than OKLCH polar Hue and Chroma.
Convert & inspect OKLab locally
Related color engineering guides
- OKLCH vs HSL vs sRGB: Understanding Wide-Gamut Display P3Compare HSL, sRGB Hex, Display P3, and OKLCH across perceptual lightness, gradient dead zones, gamut volume, and CSS progressive enhancement.
- Fix a muddy CSS gradient midpointCompare a CSS gradient midpoint in sRGB, OKLab and OKLCH using the same two stops. Choose a hue path or add a middle stop to control the transition.
- One swatch in RGB, HSL, HSV, HWB and OKLabUse #336699 as a reference to check a color picker, a CSS declaration or a shader. Compare the same swatch in eight notations and find where round-trip errors start.
OKLab frequently asked questions
When should I pick oklab() instead of oklch()?
Use oklch() for authoring human-readable palette tokens and oklab() when interpolating CSS gradients or blending two complementary colors smoothly.
How is OKLab converted to OKLCH?
Directly via polar coordinates: C = sqrt(a^2 + b^2) and H = atan2(b, a) in degrees, with identical L.