Why OKLCH is the right color space for terminal palettes
Working in sRGB hex forces every theme author to eyeball relationships the eye actually wants expressed in perceptual lightness, chroma, and hue. OKLCH gives you those three axes directly — you can step through a ramp of eight backgrounds and know they'll feel evenly spaced, not just compute evenly.
A palette is a contract with your attention. OKLCH makes the contract explicit; RGB hides it behind gamma.
The CSS spec lets us ship oklch(0.23 0.016 264.1) directly
and browsers will interpolate correctly in the same space. See CSS Color Module Level 4 § 9.3 for the gritty bits.
A small example
:root { --accent: oklch(0.62 0.18 280); --accent-hover: oklch(from var(--accent) calc(l + 0.08) c h); }
from syntax lets you derive hover /
active variants without touching the hue, which keeps the family coherent
across both light and dark themes.
oklch(...) lands in Safari Technology
Preview, Chrome, Firefox, and Edge — but pre-2023 engines fall back to
transparent. Ship a hex fallback via
@supports not (color: oklch(0 0 0)).