OKLCH vs OKLAB: What's the Difference?
Understand Cartesian vs cylindrical representations of the Oklab color space.
Key Technical Takeaway
OKLAB uses Cartesian coordinates (L, a, b) along green-red and blue-yellow axes, making it ideal for mathematical interpolation. OKLCH is the cylindrical polar form (L, C, H) of OKLAB, making it human-friendly for adjusting lightness, chroma, and hue.
The Relationship Between OKLAB and OKLCH
OKLAB and OKLCH describe the exact same underlying color space created by Björn Ottosson. OKLAB uses 3D Cartesian coordinates (L, a, b), whereas OKLCH transforms those coordinates into cylindrical polar form (Lightness, Chroma, Hue angle). They are mathematically interchangeable representations of the same perceptual space.
OKLAB Coordinate System: L, a, b
OKLAB specifies color along three orthogonal axes: Lightness (L from 0 to 1), a-axis (green-to-red spectrum, typically -0.4 to +0.4), and b-axis (blue-to-yellow spectrum, typically -0.4 to +0.4). Because a and b represent linear spatial dimensions, calculating Delta E distances or performing linear color mixing is straightforward in OKLAB.
/* OKLAB Syntax in CSS */
.element {
background-color: oklab(0.65 0.15 -0.10);
/* L: Lightness (0.65)
a: Redness (+0.15)
b: Blueness (-0.10) */
}OKLCH Coordinate System: L, C, H
OKLCH converts the (a, b) plane into polar coordinates: Chroma (C) represents radial distance from the neutral axis, and Hue angle (H) represents rotation around the circle from 0° to 360°. This cylindrical representation aligns with human intuition.
/* Mathematical Conversion Formulas */
Chroma (C) = sqrt(a^2 + b^2)
Hue (H) = atan2(b, a) * (180 / PI) (normalized to 0-360deg)
/* OKLCH Syntax in CSS */
.element {
background-color: oklch(0.65 0.18 326);
/* L: Lightness (0.65)
C: Chroma (0.18)
H: Hue angle (326deg) */
}When to Use OKLAB vs OKLCH
Use OKLAB when implementing color blending algorithms, calculating Delta E perceptual color differences, or working with automated matrix transformations. Use OKLCH when designing UI themes, tweaking hue angles, constructing shade scales, or hand-crafting CSS custom properties.
| Property | OKLAB | OKLCH |
|---|---|---|
| Coordinate System | Cartesian (L, a, b) | Cylindrical Polar (L, C, H) |
| Human Intuition | Abstract (a & b values hard to visualize) | Intuitive (Lightness, Intensity, Hue) |
| Primary Use Case | Algorithmic color mixing & distance | Design systems, themes, UI colors |
| CSS Functions | oklab(L a b [/ A]) | oklch(L C H [/ A]) |
| Interpolation Default | Used in CSS color-mix() by default | Excellent for polar hue transitions |