Skip to content
hexcolorcodepicker.com

What Is OKLCH? The Modern Color Format

What is OKLCH?

OKLCH is a modern color format that describes a color by lightness, chroma, and hue. It was designed so that equal steps in its numbers look like equal steps to the human eye. That makes it a better tool for building color scales than the older HSL format.

OKLCH stands for OK Lightness, Chroma, and Hue. It is part of CSS Color Level 4, so modern browsers can use it directly in CSS. It builds on OKLab, a color space designed for perceptual uniformity. Unlike HEX and RGB, which describe how a screen makes a color, OKLCH describes how a person sees it. Try the picker on the Hex Color Code Picker homepage to see the same color in HEX and in OKLCH side by side.

L / C / H explorer

The second swatch is the same color as HEX:

What do L, C, and H mean?

L is lightness, C is chroma, and H is hue. Lightness runs from black to white, chroma runs from gray to vivid, and hue runs around the color wheel. Change one value and only that quality of the color changes.

Lightness, written as L, runs from 0 for black to 1 for white. Chroma, written as C, measures how vivid a color is: 0 means a plain gray, and higher values mean a stronger color. Hue, written as H, is an angle from 0 to 360 degrees around the OKLCH wheel, so about 29 is red, 143 is green, and 264 is blue — the wheel is rotated from the HSL wheel, so the same color sits at a different angle.

Three-part color builder

Tap or drag any strip: lightness changes only how light the swatch is, chroma only how vivid it is, hue only which color it is.

Why HSL lightness lies

HSL lightness lies because two colors with the same HSL lightness can look very different in brightness. A yellow and a blue both set to 50% lightness do not look equally bright: the yellow looks much brighter than the blue. HSL measures a formula, not what your eye sees.

HSL lightness is a simple average of the brightest and darkest RGB channels, so it treats every hue the same. Human eyes are far more sensitive to yellow-green light than to blue light, so a yellow at 50% lightness looks bright while a blue at 50% lightness looks dark. Designers who trust HSL lightness end up with text and buttons that look uneven, even though the numbers match.

Yellow vs blue at 50% lightness

Yellow — HSL lightness 50%

Blue — HSL lightness 50%

Both start at 50%. Drag the sliders until the two look equally bright, then read how far apart the lightness values had to move.

Perceptual uniformity: equal steps that look equal

Perceptual uniformity means that equal steps in the numbers look like equal steps to your eye. In OKLCH, raising lightness by the same amount always looks like the same change, whatever the hue is. In HSL, the same step can look big in one hue and tiny in another.

A color scale is a row of shades from dark to light, used for backgrounds, hover states, and text. In HSL, the middle steps of a yellow scale look washed out while the middle steps of a blue scale look muddy, because the steps are not even to the eye. In OKLCH, the steps look even across every hue, so a scale built from OKLCH gives clean, predictable shades with no surprise jumps.

Two color scales compared

HSL scale

OKLCH scale

Move the hue slider: the HSL row goes uneven while the OKLCH row stays even at every hue.

OKLCH in CSS: CSS Color Level 4

OKLCH works in CSS through the oklch() function, defined in CSS Color Level 4. You write oklch() with lightness, chroma, and hue, and a modern browser renders it directly. Older browsers need a fallback color written first.

The CSS form is oklch(L C H), with lightness as a number or percentage, chroma as a number, and hue as an angle in degrees. OKLCH can also describe colors outside the sRGB range that HEX cannot express, which matters on wide-gamut screens. Because support is modern, not universal, always write a HEX fallback line before the OKLCH line so older browsers still show a color.

CSS code with live preview

Where to use OKLCH, and where not to

Use OKLCH for color scales, design systems, and gradients; keep HEX for sharing and simple copy-paste. OKLCH wins when you need even steps or vivid colors, and HEX wins when you need a short code every tool understands.

OKLCH is the right choice when you build a palette of tints and shades, when you design a gradient that should not pass through gray in the middle, and when you need the same lightness across different hues. HEX is still the right choice for pasting a color into most design tools, for sharing a color in a message, and for any code that must work in older browsers. Use the HEX to OKLCH Converter to move between the two.

Next, read How to Check Contrast for Readable Text.

Use-case picker

HEX to OKLCH Converter

Frequently asked questions

OKLCH stands for OK Lightness, Chroma, and Hue. The OK comes from OKLab, the color space it is built on. L is lightness from black to white, C is chroma from gray to vivid, and H is hue as an angle from 0 to 360 degrees around the color wheel.