How to Convert OKLab to LCH
Converting OKLab to LCH takes a modern, Cartesian color space and translates it into an older, cylindrical format. While OKLab is mathematically superior, LCH is often preferred for its intuitive Lightness, Chroma, and Hue controls.
The Evolution of Perceptual Color
LCH is based on the CIELAB color space, which was standardized in 1976. While it was a massive leap forward for perceptual color, it has a known bug: the "blue shift." When you create a gradient from blue to white in LCH, the transition often turns purple.
OKLab fixes this blue shift, ensuring that gradients and color mixing are perfectly smooth and hue-stable. However, if you need the cylindrical controls of LCH for a specific tool or legacy system, you must convert the color back to the older CIELAB math.
The Conversion Process
Because they use different underlying mathematical models, you cannot simply use trigonometry to convert OKLab to LCH. The color must pass through a complex pipeline:
- OKLab to Linear RGB: The OKLab values are converted to Linear sRGB using inverse LMS matrices.
- Linear RGB to CIELAB: The linear light is processed through the CIE XYZ reference space to generate CIELAB
L,a, andbcoordinates. - CIELAB to LCH: Trigonometry is used to convert the
aandbcoordinates into the Chroma and Hue values for LCH.