🌐 English

Home › Guides

Understanding OKLCH

OKLCH is a color notation designed around how bright colors look to people. It makes it easy to build several colors of truly equal lightness, which HSL struggles with, and design systems are adopting it quickly.

The three values

OKLCH describes a color with L, C and H. oklch(54% 0.24 293) is a purple with 54 percent lightness, a chroma of 0.24 and a hue of 293 degrees. It looks similar in shape to HSL, but the math behind it differs.

The HSL problem: equal L is not equal brightness

In HSL, yellow hsl(60, 100%, 50%) and blue hsl(240, 100%, 50%) both have 50 percent lightness. To the eye, though, yellow looks much brighter and blue much darker. A palette made by holding HSL lightness constant therefore gives text contrast that varies from color to color.

OKLCH was built to fix this. Colors with the same L look about equally bright even when their hues differ, and their contrast ratios come out similar. That lets you keep a rule such as the 300 step of every hue should have about the same brightness.

What you gain in palettes

Three practical differences show up in everyday work. If you already have an HSL palette, do not throw it away; convert it to OKLCH and compare whether the lightness values are even. Seeing which step stands out shows you what to fix.

Things to watch

First, not every OKLCH value can be shown on a screen. If chroma is too high the color falls outside standard sRGB, and it gets clipped to a nearby displayable color, which can look different from what you intended. The very light and very dark ends of any hue can only hold a smaller maximum chroma.

Second, very old environments may not understand the notation, so for important places keep a HEX fallback beside it. The color converter turns HEX into OKLCH and back, which makes fallback values easy to produce.

Getting started

The easiest start is to enter the HEX of your current brand color into the converter and read its OKLCH values. Then change only L in steps of about 10 percent to make lighter and darker steps, and reduce chroma slightly toward both ends. The palette generator makes such steps automatically, so looking at its output first and understanding afterwards also works well.

The core idea is simple: when adjusting a color, treat lightness as L, vividness as C and color as H. Changing one does not drag the others along with it.

Common mistakes

A few things regularly trip up people who use OKLCH for the first time. Knowing them in advance reduces trial and error. HSL may feel more familiar at first, but build one stepped palette in OKLCH and you will notice at once how evenly the brightness comes out across hues. You do not need to change everything; try it on your next new palette.