OKLCH to RGB Converter
Convert an OKLCH color (Lightness, Chroma, Hue) to RGB, entirely in your browser.
L: 0.6 C: 0.15 H: 250°
RGB
rgb(39, 132, 213)
Other Formats
rgb(15.3%, 51.8%, 83.5%)#2784d5How OKLCH to RGB conversion works
OKLCHis a cylindrical form of the perceptually uniform OKLab color space, expressed as Lightness (0–1), Chroma (colorfulness), and Hue (0–360°). It's increasingly used in modern CSS for building color scales and gradients that stay visually consistent across hues. RGB is the classic device color model (red, green, blue channels, 0–255 each) that browsers, image formats, and most design tools ultimately render with.
To convert, this tool first turns OKLCH into OKLab (a = C·cos(H), b = C·sin(H)), then reverses Björn Ottosson's OKLab transform to get linear LMS values, converts those to linear sRGB via a fixed matrix, and finally gamma-encodes the result to standard 8-bit sRGB — all client-side in your browser, with nothing sent to a server. Since OKLCH can describe colors outside the sRGB gamut (colors your screen can't reproduce), out-of-gamut inputs are clamped to the nearest valid RGB color and flagged above.
Need a different target format? Try OKLCH to HEX, OKLCH to HSL, or go the other way with OKLCH Color Converter (HEX to OKLCH/OKLab), plus the all-in-one color converter.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Getting concrete RGB values from a palette authored perceptually.
- Producing a fallback for a browser without OKLCH support.
- Checking how far outside sRGB an OKLCH colour sits.
- Converting a token for a tool that only speaks RGB.
- Comparing two OKLCH colours by their RGB output.
Frequently Asked Questions
- How does this differ from converting to hex?
- Only in notation and precision. Hex quantises to 8 bits per channel; rgb() can carry decimals and supports an alpha argument directly. Both are sRGB, so both hit the same gamut limit — the difference is what you can express afterwards.
- What are the conversion steps?
- OKLCH to OKLab (polar to cartesian), OKLab to linear sRGB via a matrix, then apply the sRGB transfer function to get the gamma-encoded values. Skipping the transfer function is the classic error and gives colours that are far too dark.
- Why are the numbers not whole?
- Because the maths is continuous and sRGB channels are not. Rounding to integers is what browsers do for legacy rgb(), but modern CSS accepts decimals and keeps a little more precision in intermediate calculations.
- Can rgb() hold an out-of-gamut colour?
- No — values are clamped to 0-255. To express wider gamuts CSS Color 4 provides color(display-p3 ...) and lab()/lch(), which is the actual reason those functions were added.
- What is the point of OKLCH if it converts back to RGB anyway?
- Authoring. Generating a palette, a gradient or a set of accessible tints is far easier in a perceptually uniform space — you adjust one number and get a predictable visual result. The conversion is just the delivery step.
Common errors and gotchas
- Expecting every value to convert cleanly, since OKLCH covers colours sRGB cannot show.
- Reading a clamped channel as an error rather than the gamut boundary.
- Assuming equal OKLCH steps produce equal RGB steps, which is the whole point of the difference.
- Losing the chroma relationship when channels clip unevenly.
- Using the RGB output as the source of truth, which discards the perceptual structure.