Stop picking random colors in RGB: XorDev explains why Oklab/Oklch gives fairer results

XorDev · x · 2026-10-19

XorDev advises that for random color selection (e.g. procedurally coloring objects), you should use the Oklab or Oklch color space instead of RGB or HSV. While RGB spans the whole spectrum, it doesn't pick fairly and tends to produce dark, muddy colors.

Oklab is designed to closely match human color perception, so random samples look perceptually uniform and vibrant. A replier notes that for random hue specifically, a tiny 1D LUT can be even cheaper.

Original post →

More from coding & agent

coding & agent channel →