LCH and OKLCH: Perceptually Uniform Color Models
You'll learn: How LCH and OKLCH color models represent colors in a way that matches how humans actually perceive brightness and color differences.
The Problem with RGB and HSL
Traditional color models like RGB and HSL don't match human vision. In HSL, hsl(240, 100%, 50%) (blue) looks darker than hsl(60, 100%, 50%) (yellow), even though both claim 50% lightness. Our eyes perceive different hues at different brightness levels, making consistent color palettes tricky.
How LCH and OKLCH Work
LCH (Lightness, Chroma, Hue) and OKLCH (improved version) describe colors based on:
- L (Lightness): 0% = black, 100% = white — perceptually uniform across all hues
- C (Chroma): Color intensity/saturation (0 = gray, higher = vibrant)
- H (Hue): Angle on color wheel (0° = red, 120° ≈ green, 240° ≈ blue)
Think of it like describing a paint: how light it is, how colorful vs grayish, and what color family it belongs to.
CSS Syntax
.element {
/* LCH: lightness, chroma, hue */
background: lch(60% 50 240);
/* OKLCH: improved perceptual uniformity */
color: oklch(70% 0.15 145);
}
OKLCH is generally preferred because it's even more accurate to human perception — colors with the same L value will appear equally bright regardless of hue.
Why This Matters
When you adjust lightness in OKLCH, all colors change brightness uniformly. This makes creating accessible color palettes, consistent gradients, and dynamic color schemes much easier than with HSL or RGB.
Key Takeaway: LCH and OKLCH model colors the way humans see them—making L=50% actually look the same brightness across all hues, unlike HSL where colors appear inconsistent.