ThatDev.Shparki

Today I Learned

TIL: OKLCH is the future of CSS colors

css colors til

Discovered OKLCH today while building my site’s color system. It’s a perceptually uniform color space that makes color manipulation actually predictable.

/* OKLCH: Lightness, Chroma, Hue */
--neon-cyan: oklch(0.6 0.2 195);

/* Want a darker version? Just adjust L */
--neon-cyan-dark: oklch(0.4 0.2 195);

/* Same perceived saturation across different hues */
--neon-magenta: oklch(0.6 0.2 330);

Why it matters: Unlike HSL, changing the lightness in OKLCH actually produces visually consistent results. A 50% lightness blue and 50% lightness yellow will actually look equally bright.

Tailwind 4 and modern browsers support it natively. No more guessing why your color palette looks off.