Convert HEX color codes into OKLab, a newer perceptually uniform color space designed to correct hue-shift problems in older models like CIELAB.
Input formats
Provide colors as 3, 4, 6, or 8-digit hex codes, with or without a leading #. Each line is parsed independently in batch mode.
OKLab output
#FF5733 becomes oklab(68.04% 0.1747 0.1165). Lightness prints as a percentage; the a and b axes print as small signed numbers, usually within about -0.4 to 0.4.
Why OKLab exists
CIELAB, published in 1976, shifts hue and saturation unevenly in some regions as lightness changes, which shows up as unwanted color casts in gradients and blends. OKLab was designed in 2020 to keep hue steadier across the same lightness and chroma range, and now backs CSS Color 4 features like oklch() and color-mix() in the OKLab space.