Tools / Color Converter / RGB → OKLCH
RGB to OKLCH Converter.
RGB to OKLCH lifts a standard 0-255 color into the perceptual OKLCH space. It's the conversion behind modern, accessible design tokens: store hue and chroma once, then generate a whole tint ramp by stepping lightness — and the steps actually look even.
Not a recognizable RGB color.
All formats
The RGB → OKLCH formula
Normalize and linearize RGB, apply the OKLab matrix, take cube roots, then convert the resulting (L, a, b) to polar (L, C, H).
Worked example
Convert rgb(154, 42, 42):
- Linearize → OKLab
- L ≈ 0.43, a ≈ 0.13, b ≈ 0.06
- C = √(a²+b²) ≈ 0.14, H = atan2(b,a) ≈ 26°
- Result: oklch(43% 0.14 26)
JavaScript
// see rgbToOklch in colorConvert.ts (Ottosson OKLab matrices)
rgbToOklch({r:154,g:42,b:42}); // {l:0.43, c:0.14, h:26} FAQ
What's a typical chroma value?
OKLCH chroma usually runs 0 (grey) to about 0.37 (most vivid sRGB). Muted, editorial palettes sit around 0.02-0.08; brand accents around 0.1-0.2.