OKLCH Color Picker and Gamut Checker
Set a color by lightness (L), chroma (C) and hue (H), or paste a HEX code to load its OKLCH values. The tool shows the oklch(), HEX and RGB values and tells you whether the color fits sRGB, needs a Display P3 screen, or lies outside both.
OKLCH Values
CSS Output
oklch()
oklch(0.702 0.150 200)
HEX
#00b9c4
RGB
rgb(0, 185, 196)
Related Developer Tools
Runs in your browser: your files and text are not uploaded. Free, no account needed.
Last updated: · Reviewed by the QuickTooly Team
How OKLCH and the gamut check work
The Three OKLCH Numbers
- L, lightness, 0 to 1. 0 is black and 1 is white. OKLCH is built so that equal steps in L look like roughly equal steps in brightness, whatever the hue.
- C, chroma, 0 to 0.4 here. 0 is gray. How much chroma a color can have before it leaves sRGB depends on its lightness and hue, so there is no single safe maximum.
- H, hue, 0 to 360 degrees. The angle on the color wheel. A gray has no hue, so when you paste one the tool keeps the previous H value.
The oklch() output rounds L and C to three decimals and H to whole degrees, for example oklch(0.702 0.150 200).
How the Gamut Badge Is Decided
The tool converts the color to sRGB with culori. If every channel lands between 0 and 1, with a 0.001 tolerance, the badge says sRGB safe. If not, it converts the color to Display P3 and runs the same test. A color that fails both is marked Outside P3.
Worked example: hue 30, lightness 0.7
oklch(0.7 0.15 30)gives sRGB channels 0.929, 0.463 and 0.394. All are in range: sRGB safe, HEX#ed7665.oklch(0.7 0.2 30)has a red channel of 1.014 in sRGB, so it is out. In Display P3 the channels are 0.941, 0.423 and 0.338, so the badge says P3.oklch(0.7 0.3 30)still has a red channel of 1.075 in Display P3: Outside P3.
How Out-of-Gamut Colors Are Clipped
HEX and RGB cannot hold values outside 0–255, so the tool clips each channel separately. Clipping shifts the hue and lightness a little. For oklch(0.7 0.2 30) the clipped HEX is #ff614d.
Lowering chroma instead keeps L and H unchanged. culori's clampChroma function brings the same color to a chroma of about 0.192, which is #ff6551. The tool does not do this step for you: drag C down until the badge says sRGB safe if you need a faithful sRGB fallback.
OKLCH Picker Questions
Why did my HEX code change slightly after I pasted it?
Pasting a HEX code sets L and C rounded to three decimals and H rounded to a whole degree. The HEX field is then rebuilt from those rounded values, so it can differ from your input by one step in a channel.
Can I paste rgb() or hsl() values?
No. The field holds 7 characters, enough for #RRGGBB or a short color name such as red. Convert longer values to HEX first with the HEX to RGBA converter.
How is OKLCH different from HSL?
Both use a hue angle, but HSL lightness is not perceptual: hsl(60, 100%, 50%) yellow looks much brighter than hsl(240, 100%, 50%) blue. In OKLCH, colors with the same L look similar in brightness, which makes color scales easier to build.
Related Color Tools
- Color Shades Generator: build a 50–950 scale from one color using fixed OKLCH lightness steps.
- HEX to RGBA Converter: add an alpha channel and copy oklch() with a / alpha part.
- Tailwind Color Converter: find the nearest Tailwind palette class for the HEX output.