hexcolors

Learn / Blog / Accessibility

How to build an accessible color palette from scratch

Design for contrast first, then pick colors, so every approved pair is readable.

November 19, 20261 min readBy the hexcolors team

Key takeaways

  • Decide your text and background pairs before you fall in love with colors.
  • Use a lightness scale so light and dark steps pass automatically.
  • Never let color be the only signal.

Most teams pick colors first and discover contrast problems later. Flip the order and accessibility becomes a design constraint instead of a late fix.

Start with the lightness range

Contrast is mostly about lightness, not hue. If your backgrounds are very light and your text is very dark, almost any hue will pass. Build each main color as a scale from pale to deep with the shade scale generator, and use the ends of the scale for backgrounds and text.

Define the allowed pairs

Write down which text steps are allowed on which background steps, for example 900 on 50 and 50 on 700. Test them once, in bulk, with the contrast matrix. Anything that reaches 4.5:1 can be used for body text.

Check interface components

WCAG asks for at least 3:1 for the visual parts of controls, such as input borders, icons and focus rings, against their surroundings. A pale gray border on white often fails.

Do not rely on color alone

Error states should have an icon and a message, charts should have labels, and links in body text should be underlined or otherwise distinguishable. See our guide to designing for color blindness.

Pick status colors carefully

Success, warning and error colors need enough contrast on their own backgrounds, and warning yellow is the hardest. Use a dark text color on yellow, never white. You can see why on the #FAE520 page, where white text fails and black passes.

Retest when anything changes

A new brand color, a dark mode or a hover state all create new pairs. Keep the matrix handy and rerun it. For the math behind the thresholds, read WCAG contrast ratio explained.

The hexcolors teamWe build free color tools and write practical guides. Follow us on X, Instagram and LinkedIn.