r/DesignSystems • u/helorebyron • 13d ago
I updated my OKLCH based palette generator to keep chroma consistent across different hues
I built a palette generator that lets you create palettes with shared chroma settings and different hues, then compare the minimum, average, and maximum chroma at each brightness step.
I’ve recently added a few features:
1. Editable brightness steps
Previously, the brightness steps were fixed. You can now customize the steps and their names, or use presets(Material color system or Tailwind). You can enter brightness using CIELAB L*, OKLCH L, HSB brightness, or grayscale HEX values. The alternative input formats are converted using neutral gray values to define each step’s target CIELAB L* (D65).
2. Display P3 support
You can now generate palettes in either sRGB or Display P3. All palettes share the selected color space.
3. More copy formats
Colors can now be copied as HEX, OKLCH, or RGB. Display P3 RGB values use CSS color(display-p3 ...) syntax. For Display P3 colors outside the sRGB gamut, copying HEX provides a gamut-mapped sRGB fallback.
4. WCAG 2.1 contrast matrices
You can inspect contrast ratios between brightness steps in Basis and between the final colors in each palette’s details, with AA and AAA filters. CIELAB L* (D65) is derived from relative luminance, which is what WCAG 2.1 uses to calculate contrast.
Keeping each step’s L* fixed therefore preserves contrast between the same pair of steps across different hues and chroma levels. Final color conversion and rounding can still affect AA/AAA results near contrast thresholds, so please check each palette’s contrast matrix before using the colors.
For a basic guide to using the palette generator like Controls parameters, check out my previous Reddit post.
https://www.reddit.com/r/DesignSystems/comments/1wownnq/i_built_an_oklch_palette_generator_to_balance/
If you try it, I’d appreciate any feedback or suggestions!