OKLCh to RGB
If the chroma you asked for is not reachable in sRGB, the result is the closest color that is, keeping hue and lightness intact.
Paste a OKLCh value. Other formats work too.
rgb(0 171 231)Need every format at once? Open in the full picker
Worked examples
Common colors converted from OKLCh to RGB, computed with the same engine the picker uses.
| Color | OKLCh | RGB | Copy |
|---|---|---|---|
| Pure red | oklch(62.796% 0.25768 29.234) | rgb(255 0 0) | |
| Pure green | oklch(86.644% 0.29483 142.495) | rgb(0 255 0) | |
| Pure blue | oklch(45.201% 0.31321 264.052) | rgb(0 0 255) | |
| White | oklch(100% 0 0) | rgb(255 255 255) | |
| Mid gray | oklch(59.987% 0 0) | rgb(128 128 128) | |
| Black | oklch(0% 0 0) | rgb(0 0 0) | |
| Interface blue | oklch(63.521% 0.17906 259.418) | rgb(66 135 245) | |
| Success green | oklch(72.275% 0.19201 149.579) | rgb(34 197 94) | |
| Danger red | oklch(63.683% 0.20785 25.331) | rgb(239 68 68) | |
| Warning amber | oklch(76.859% 0.16466 70.08) | rgb(245 158 11) | |
| Editor black | oklch(23.503% 0 0) | rgb(30 30 30) | |
| Warm sand | oklch(83.419% 0.11701 87.428) | rgb(233 196 106) |
How the conversion works
If the chroma you asked for is not reachable in sRGB, the result is the closest color that is, keeping hue and lightness intact.
Both formats are computed from a single canonical representation (CIE XYZ with a D65 white point, held in floating point) rather than by chaining one format into the next. That matters because chained conversions accumulate rounding error, and because it means a color that cannot be represented in the target format is handled deliberately rather than by accident.
When the source describes a color outside the target's gamut, chroma is reduced in OKLCh while lightness and hue are held, following the CSS Color 4 gamut mapping algorithm. Clipping each channel independently would be simpler but visibly shifts hue on saturated colors.