Color Ramp Generator for Design Systems
Generate perceptually uniform color ramps for design systems. Hybrid ink-paint mixing with CIE Lab lightness targeting. Export to Tailwind, CSS, and JSON.
About
Design system color ramps that rely on naive RGB interpolation toward white or black produce perceptually uneven steps. A 10% increment in sRGB channel value does not correspond to a 10% perceived lightness change because human vision follows a roughly cube-root response curve, formalized in CIE L* (Lightness). This tool solves that problem. It computes ramps along the CIE L* axis from 0 (black) to 100 (white), producing steps that look evenly spaced to the human eye. The mixing model blends two strategies: paint mixing (linear interpolation toward white/black in linear RGB) and ink mixing (scaling color concentration, simulating Beer-Lambert absorption). A saturation parameter controls the ratio. At 0 you get pure paint; at 1, pure ink. The default 0.4 produces ramps where hue and chroma shift naturally across the lightness range rather than washing out.
Misconfigured ramps cause accessibility failures. If your 500-step doesn't land near L* ≈ 50, your text-on-background pairs will fail WCAG 2.1 contrast ratios. This tool displays the contrast ratio of each swatch against white and black so you can verify compliance before committing tokens to your design system. Note: gamut clipping occurs when a target lightness requires RGB values outside 0 - 255. Clipped swatches are flagged.
Formulas
The generator converts the input hex to linear RGB, then for each target lightness step computes two candidate colors and blends them.
Paint mixing (tint/shade interpolation in linear RGB):
Cpaint = Cbase β t + Ctarget β (1 β t)
where Ctarget = white (1,1,1) for lightening and black (0,0,0) for darkening.
Ink mixing (concentration scaling via Beer-Lambert):
Cink = 1 β (1 β Cbase)k
where k controls concentration. k < 1 dilutes (lighter), k > 1 concentrates (darker).
Hybrid blend:
Cfinal = Cpaint β (1 β s) + Cink β s
where s = saturation parameter (0 - 1).
CIE L* from linear RGB:
Y = 0.2126R + 0.7152G + 0.0722B
L* = 116 β f(YYn) β 16
where f(t) = t1/3 if t > Ξ΄3, else t3Ξ΄2 + 429, and Ξ΄ = 629.
where C = channel value in linear RGB, t = interpolation factor, k = concentration exponent, s = saturation (ink ratio), Y = relative luminance, Yn = reference white luminance (1.0 for D65), L* = CIE perceptual lightness (0 - 100).
Reference Data
| Tailwind Step | Target L* (CIE) | Typical Use | Min Contrast vs White (WCAG AA) | Min Contrast vs Black (WCAG AA) |
|---|---|---|---|---|
| 50 | 97 | Background tint | 1.02:1 - decorative only | 18.4:1 ✓ |
| 100 | 93 | Hover state bg | 1.07:1 - decorative only | 16.1:1 ✓ |
| 200 | 84 | Border, divider | 1.29:1 - fail | 12.2:1 ✓ |
| 300 | 74 | Icon secondary | 1.72:1 - fail | 9.0:1 ✓ |
| 400 | 64 | Placeholder text | 2.39:1 - fail | 6.5:1 ✓ |
| 500 | 53 | Primary / CTA | 3.53:1 - AA Large | 4.6:1 ✓ |
| 600 | 43 | Primary hover | 5.15:1 ✓ | 3.2:1 - fail |
| 700 | 33 | Heading text | 7.69:1 ✓ | 2.2:1 - fail |
| 800 | 23 | Body text | 11.2:1 ✓ | 1.5:1 - fail |
| 900 | 15 | High-emphasis text | 14.5:1 ✓ | 1.2:1 - fail |
| 950 | 7 | Near-black accent | 17.9:1 ✓ | 1.05:1 - decorative |