mockstack.
Updated November 2026 · 8 min read

Choosing an
Accessible Palette.

Palettes chosen by eye often fail an audit later. Contrast is a specific ratio you calculate from the luminance of two colors.

AA body 4.5:1 AA large 3:1 AAA body 7:1 Large means 24px, or 18.66 bold

What the Ratio Measures

WCAG contrast compares the relative luminance of two colors. Each channel is normalized, linearized through the sRGB transfer curve, then weighted: red 0.2126, green 0.7152, blue 0.0722. The ratio is (L1 + 0.05) / (L2 + 0.05), running from 1:1 for identical colors to 21:1 for black on white.

Those weights are why green carries most of the perceived brightness and blue almost none. A saturated blue and a saturated red can look equally dark and be far apart in luminance, which is the usual reason a pairing fails when it looked fine.

The Thresholds

RuleBody TextLarge TextUI and Graphics
AA4.5:13:13:1
AAA7:14.5:1not defined

Large means at least 24px, or 18.66px if bold. Below that the body threshold applies: a 20px semibold subheading is body text as far as the rules are concerned.

User interface components count too. Under AA, the border of an input, the edge of a toggle, and any icon carrying meaning all need 3:1 against what is behind them. Purely decorative graphics are exempt.

Building a Palette That Passes

Start from a neutral ramp. Your accent comes later. Pick a near-black for text and a near-white for the page, confirm they clear 7:1, and build the grays between them in even luminance steps. That ramp will carry most of your interface.

Then bring in the brand color and accept that it probably fails as body text. Many brand colors do. Keep it, and give it the jobs it can do: large display type, fills behind white or black text, borders, and decorative accents. For links and small text, use a darkened step from the same hue.

Darkening in HSL keeps the hue and drops the lightness, which preserves brand recognition while moving luminance. Two or three steps down is usually enough to clear 4.5:1 on a light page.

A brand color that fails on white will usually pass as a background with white or near-black text on top. Check both directions before you rule it out.

What the Ratio Does Not Cover

Contrast is only part of color accessibility. Around 8 percent of men have some form of color vision deficiency, most commonly red and green confusion. A pass or fail state signaled only by color is invisible to them regardless of contrast, which is why WCAG separately requires that color is never the sole carrier of meaning. Add an icon, a label, or a shape.

There is also a newer model, APCA, designed to fix the known weaknesses in the WCAG formula, particularly around very dark backgrounds where the current math is too lenient. It is not yet a requirement. Design to WCAG, and treat APCA as a second opinion.

Practical Checks