oklch
ELI5 — The Vibe Check
oklch is a color format that actually makes sense to human brains. Unlike hex codes that look like someone smashed the keyboard, oklch uses lightness, chroma, and hue — so 'make it lighter' means changing one number. Revolutionary, honestly.
Real Talk
oklch (Oklab Lightness Chroma Hue) is a perceptually uniform color space where equal numeric changes produce visually equal color differences. It offers a wider gamut than sRGB, predictable lightness adjustments, and consistent saturation across hues — solving issues with HSL's uneven perceptual brightness.
Show Me The Code
:root {
--primary: oklch(0.65 0.2 260);
--primary-light: oklch(0.85 0.1 260);
--primary-dark: oklch(0.45 0.2 260);
}
When You'll Hear This
"oklch makes palette generation trivial — same chroma and hue, just change lightness" / "We switched to oklch because our HSL blues looked way brighter than our HSL greens at the same lightness"
Related Terms
Color Functions
CSS color functions let you mix, lighten, darken, and adjust colors right in your stylesheet.
CSS Clamp
clamp() is CSS's way of saying 'be this size, but never smaller than this and never bigger than that.
Design Tokens
Design tokens are the single source of truth for your design decisions — colors, spacing, fonts — stored as variables that work everywhere.