Paper I — Measuring Palette Quality

A sequential color ramp (e.g. blue-50blue-900) is good when it is perceptually even, accessible, and artifact-free. @domphy/palette makes that measurable with five metrics, all computed in the CIELAB color space (lightness, chroma, hue, and ΔE2000 all derived there).

The five metrics

Each metric normalizes to [0, 1]; Ramp.score is the geometric mean, scaled to 0–100.

  1. Contrast Efficiency — how efficiently the ramp uses its lightness range to reach a WCAG 4.5:1 contrast pair. A ramp that wastes lightness span (or never reaches 4.5:1) scores low.
  2. Lightness Linearity — how linear the lightness progression is across the steps, with a Helmholtz–Kohlrausch correction (so highly-chromatic steps that look lighter are accounted for). Even visual steps → high score.
  3. Chroma Smoothness — detects kinks and artifacts in the saturation curve using monotone cubic splines. A smooth chroma arc scores high; a jagged one (a step that suddenly desaturates) scores low.
  4. Hue Stability — quantifies hue drift across the lightness ramp. A ramp that stays "the same color" from light to dark scores high; one that shifts hue (blue → purple at the dark end) scores low.
  5. Spacing Uniformity — consistency of perceptual spacing between adjacent steps, measured with ΔE2000. Evenly-spaced steps score high.
import { Ramp } from "@domphy/palette"

const ramp = new Ramp(blueHexes, "blue")
ramp.metrics   // { contrastEfficiency, lightnessLinearity, chromaSmoothness, hueStability, spacingUniformity }
ramp.score     // 0–100

Benchmark of design systems

Popular design systems, scored on these metrics (algorithmic sequential ramps only — systems that ship discrete semantic tokens rather than ramps, like Bootstrap or Material 3, are excluded). Overall Score is the geometric mean of the five normalized metrics.

Design SystemStepsSpan (K)Contrast Eff.Lightness Lin.Chroma Smooth.Hue Stab.Spacing Unif.Score
Adobe Spectrum1890.9430.9330.8790.9140.77288.6
IBM Carbon1260.9110.9300.8690.9290.79288.5
U.S. Web Design System1260.9110.9360.8100.9380.80087.7
Salesforce Lightning 21470.9250.9190.8460.9370.71186.3
GitHub Primer Brand1260.9110.9240.8410.9410.68485.5
Atlassian1480.7710.8960.9090.9470.71384.2
Tailwind CSS1380.7560.8710.8570.9150.67881.0
Ant Design1290.6650.8590.8730.9280.65578.8
Material UI12110.5070.7970.7860.9240.55069.4
Radix UI13100.4740.7980.7680.9470.52167.8
Shopify Polaris17150.2820.7280.6890.9220.46757.2

Where Domphy sits

@domphy/theme builds on Adobe Spectrum-derived 18-step ramps — the top-scoring family in the benchmark — and @domphy/palette lets you verify that, or any palette you generate, before shipping:

import { Palette } from "@domphy/palette"
const score = new Palette({ blue, red, green }).score
if (score < 80) console.warn("palette quality below target")

Run it in CI to keep a design system's palettes measurably accessible over time.