# Perceptual Color in Code (OKLab/OKLCH) **Track:** Craft & Production — Advanced Creative Coding — proposed (50) **Framework / surface:** p5.js **Level:** Medium **Prerequisites:** Color **In one line:** Perceptually-uniform ramps, equal-lightness palettes, robust contrast. ## Theory, aesthetics & inspiration Most code still interpolates color in sRGB, where equal numeric steps look wildly uneven and blends drift through muddy grays. OKLab and its cylindrical form OKLCH, designed by Björn Ottosson in 2020, fix this with a perceptually uniform space: equal distances look equally different, lightness is decoupled from hue and chroma, and gradients stay clean. Working in OKLCH lets a palette hold constant lightness across hues, guarantee legible contrast, and rotate hue without darkening—controls that matter enormously for print and accessibility. It is the modern heir to CIELAB, now native to CSS Color 4. Perceptual uniformity turns color from guesswork into geometry.