Color and design guides

Keep an OKLCH color and choose an sRGB fallback

·

Keep the original OKLCH token when the design depends on its color coordinates. If a destination requires eight-bit sRGB, choose a fallback and record how it was produced.

OKLCH Converter

Compare the wide coral before and after a fallback

Select Wide coral. Its CSS is oklch(70% 0.4 35 / 0.6). The unclipped linear sRGB values are about 1.872825, -0.161251 and -0.107110. A channel above 1 or below 0 puts the color outside sRGB.

Keep OKLCH only leaves the original CSS and alpha available. HEX, RGB and HSL become available when you choose a fallback.

Choose Reduce chroma at fixed lightness and hue. The reduced color has chroma approximately 0.193576 and becomes #FF674199 after rounding. Choose Clip sRGB channels and compare #FF000099. Both options keep opacity at 0.6.

CSS Color 4 OKLCH coordinates and syntaxCSS Color 4 gamut mapping

Round-trip an existing sRGB token

Select sRGB terracotta. The input #C9603C99 converts to approximately oklch(61.022403% 0.14319829 39.181379 / 0.6). This input is already sRGB and needs no fallback.

Copy OKLCH CSS. Switch to OKLCH to sRGB and paste it. Expect #C9603C99 again. To inspect a neutral color, switch back to sRGB input and enter #888888. Its chroma is zero and its hue is serialized as none.

CSS Color 4 OKLCH coordinates and syntax

Save the original and the chosen fallback

In the JSON report, check the original OKLCH coordinates, the unclipped linear sRGB values and the selected fallback. Record which value your stylesheet or design export will use.

The gamut check uses the unclipped linear sRGB channels with a tolerance of 0.000001 at the bounds to absorb matrix round-off. Browser gamut mapping and the display can change how an outside-gamut color looks. Use the labeled sRGB preview to compare the explicit fallback.

CSS Color 4 OKLCH coordinates and syntaxCSS Color 4 gamut mapping

Common questions

What does a chroma of 50% mean in CSS OKLCH?

CSS defines 100% chroma as 0.4, so 50% represents 0.2. Lightness percentages use 100% for 1.

What if I enter hue -30 degrees?

The same angle is expressed as 330 degrees after wrapping around the hue circle.

Sources

Put it into practice.

Related guides