Accessible palettes, generated and verified
This generator produces random color combinations and only shows you the ones that pass WCAG contrast requirements. Instead of guessing whether your text is readable, every palette comes with the measured contrast ratio so you know it meets AA (4.5:1) or AAA (7:1) before you ship it.
How it works
Contrast is computed with the official WCAG formula. First each color’s relative luminance is found by linearising its sRGB channels:
channel = c / 255
linear = channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ^ 2.4
L = 0.2126*R + 0.7152*G + 0.0722*B
ratio = (Llight + 0.05) / (Ldark + 0.05)
The tool randomly samples a background and text color, measures the ratio, and rejects the pair if it falls below your chosen threshold. It repeats until both the text and the accent color clear the bar — so the displayed palette is always compliant.
Tips and notes
- Use AAA (7:1) for body copy where reading comfort matters; AA (4.5:1) is the legal minimum in most jurisdictions.
- Large text (24px or 18.66px bold) only needs 3:1, so you have more freedom for headings.
- Contrast alone is not full accessibility — pair it with clear focus states, hue checks, and real-device testing.