What makes a color system accessible for UIs?

Updated

An accessible UI color system is one where every text, icon, and control color pair meets a contrast threshold against its background, and where the palette stays predictable as you add or shift colors. In practice that means two things: you check contrast ratios (WCAG requires 4.5:1 for normal text and 3:1 for large text and UI components), and you build the palette in a color space where equal steps look equal. color × color is a tool built around the second point — it generates UI color systems in Okhsl or HSLuv, two perceptually uniform color spaces, so a lightness scale you define behaves consistently across hues.

The two requirements, separated

1. Contrast is the pass/fail gate

Contrast ratio is a measurable number, not a matter of taste. For any foreground/background pair:

  • Normal body text: at least 4.5:1
  • Large text (roughly 18pt regular or 14pt bold and up): at least 3:1
  • UI components and graphical objects (borders, icons, focus rings, chart lines): at least 3:1

A palette can look beautiful and still fail here. This is the check you run last, on the actual pairs you ship.

2. Perceptual uniformity is what makes the gate easy to pass

In a perceptually uniform space, moving a fixed amount in lightness produces a visually equal change, regardless of hue. That matters because human vision is not equally sensitive to all hues: a yellow and a blue at the same HSL lightness do not look equally bright, and they do not have the same contrast against white.

If you build scales in plain HSL, your "500" step for yellow and your "500" step for blue will have different contrast against the same background. You end up hand-tuning every hue, and every new color breaks the pattern.

Okhsl and HSLuv are designed to fix this. HSLuv keeps the familiar HSL model but corrects lightness and saturation to be perceptually even; Okhsl is a more recent model in the same family that aims for better behavior in the darker and more saturated regions. Building in either means a lightness step you pick once tends to hold its contrast across the whole hue wheel.

How this plays out in a real UI task

Say you need a 10-step scale for each of five brand hues, and every scale's mid step must be readable as text on white.

  1. Pick a perceptually uniform space (Okhsl or HSLuv) rather than raw HSL.
  2. Define your lightness ramp once — e.g. steps from near-white to near-black at even perceptual intervals.
  3. Apply that same ramp to every hue. Because lightness is perceptually even, the step that passes contrast on white for blue will pass for red and green too.
  4. Verify the actual pairs with a contrast checker, since uniformity gets you close but does not guarantee the 4.5:1 line for every combination.
  5. Re-check interactive states — hover, disabled, focus, and dark-mode variants are separate pairs and need their own pass.

Step 3 is where the time savings show up. Without perceptual uniformity, step 3 is manual work per hue; with it, step 3 is a copy of the same ramp.

What designers should verify before shipping

Check Why it matters
Text/background contrast ≥ 4.5:1 (normal), ≥ 3:1 (large) The core WCAG requirement
Component contrast ≥ 3:1 Borders, icons, focus indicators must be visible
Focus states distinguishable Keyboard users need a visible, high-contrast focus ring
Dark mode pairs checked separately A pair that passes on white can fail on near-black
Disabled states still legible Low-contrast disabled text is a common failure
Color not the only signal Error/success states need an icon or label, not just red/green
Scale steps evenly spaced perceptually Keeps the system predictable as it grows

Where a tool like color × color fits

color × color is described as a tool to create accessible color systems for UIs, using Okhsl or HSLuv to produce perceptually uniform colors. Its role is the palette-construction half of the problem: it gives you scales whose steps behave consistently, which removes most of the manual tuning that normally precedes contrast checking. It does not replace the contrast check itself — you still confirm the specific foreground/background pairs you ship, including dark mode and interactive states.

If your goal is a palette that stays consistent across many hues and survives a dark-mode addition without a redesign, building in a perceptually uniform space is the decision that saves the most rework. If you only need one or two colors, plain HSL plus a contrast checker is enough.