Modern CSSBy PaletteKey Team 5 min read

Why OKLCH is the Future of CSS Colors

How perceptually uniform color spaces solve the brightness glitches of HSL.

Key Technical Takeaway

OKLCH is a cylindrical color model based on the perceptually uniform Oklab space. It decouples lightness from hue, ensuring that 50% lightness looks equally bright regardless of hue angle.

The Flaw in HSL

In standard HSL, setting lightness to 50% yields wildly different perceived brightness depending on the hue. Pure yellow at 50% lightness appears dramatically brighter than pure blue at 50% lightness because human eyes are vastly more sensitive to green and yellow light wavelengths.

/* OKLCH syntax in modern CSS */
.button {
  background-color: oklch(0.65 0.22 142);
  /* L: Lightness (0% - 100% or 0 - 1)
     C: Chroma (0 - ~0.37)
     H: Hue angle (0 - 360) */
}

Put Theory into Practice with Free Color Tools

Apply the concepts from this guide directly in your web workflow with our interactive tools.