A bright brand color fails a contrast check, and the quick fix is to darken it everywhere. The interface passes and the brand goes grey.

There is a better route. Contrast is a property of a pair of colors in a specific use, not of a single swatch. A color that fails as small text on white can be correct for a large headline, a button fill with dark text, or an accent on a dark surface.

A design system is the right place to make those decisions once. This article covers the WCAG 2.2 numbers that apply, how the ratio works, and how to build contrast into tokens, states and themes so the bright color survives where it can.

The numbers that apply

WCAG 2.2 sets contrast minimums in a few success criteria. These are the ones a design system meets most often.

WCAG 2.2 contrast requirements for interface color
WhatMinimumCriterion
Body text4.5:11.4.3 Contrast (Minimum), AA
Large text3:11.4.3, AA
Controls and states3:1 against adjacent colors1.4.11 Non-text Contrast, AA
Enhanced text7:1, or 4.5:1 for large text1.4.6 Contrast (Enhanced), AAA

Large text means at least 18 point, or 14 point bold. The Understanding page gives approximate CSS equivalents of 24px and 18.5px bold. A 16px label is ordinary text even when it is bold.

Some text has no contrast requirement: text in inactive (disabled) controls, purely decorative text, and text that is part of a logo or brand name. Placeholder text is not exempt. The 1.4.3 Understanding page names it explicitly.

Most products target AA. The AAA levels are useful for long reading, but WCAG does not expect every page to meet them.

How the ratio works

The contrast ratio compares the relative luminance of two colors: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color. It runs from 1:1 (identical) to 21:1 (black on white).

Relative luminance weights the three channels unevenly. Green contributes far more than blue, which is why a saturated blue can pass on white while a yellow of similar saturation fails.

Three consequences matter in practice.

  • Hue does not decide it. Two colors that look different can have almost the same luminance and fail against each other.
  • Do not round. The Understanding page is explicit: 4.499:1 does not meet 4.5:1. #777777 on white is 4.47:1 and fails. #767676 is 4.54:1 and passes.
  • One color has no ratio. A swatch documented as “accessible” means nothing until you know what sits behind or on top of it.

Check a pair

Pick a text color and a background to see the ratio and which requirements the pair meets. The examples below the tool use a hypothetical orange brand color, #f26b1d.

Try itContrast of a color pairRatios use the WCAG 2.2 relative luminance formula.
Example pairs with a hypothetical brand orange
PairRatioMeets
White text on #f26b1d3.04:1Large text and controls only
#1a1a1a text on #f26b1d5.71:1Body text
White text on #c2410c5.17:1Body text
#f26b1d text on #1417155.92:1Body text
#f26b1d text on white3.04:1Large text only

The same orange fails as body text on white and passes as body text on a near-black surface. Nothing about the color changed. Its partner did.

Give the brand color roles it can pass

Keeping a bright color is mostly a matter of choosing where it appears. For the hypothetical orange, the pairs above suggest a split:

  • Large type and display headings: the original orange on white meets the 3:1 large-text minimum.
  • Button fills: keep the orange fill and use dark text (5.71:1), or use a deeper step such as #c2410c with white text (5.17:1).
  • Small text and links on white: use the deeper step, not the original.
  • Accents on dark surfaces: the original orange works as text on near-black.
  • Illustrations, backgrounds and decoration: no contrast requirement unless the graphic carries information someone needs.

Choosing between dark text on the bright fill and white text on a deeper fill is a brand decision, not an accessibility one. Both pass. The first keeps the color closer to the brand. The second may suit a system where buttons usually carry white text.

This is easier with a tonal scale: several steps of the brand hue from light to dark. Record which steps pass as text on your main surfaces, and the scale becomes a lookup instead of a debate.

Test pairs, not swatches

If your system uses semantic design tokens, contrast belongs at the semantic layer, where a foreground token is defined for use on a specific background token.

:root {
  --palette-orange-500: #f26b1d;
  --palette-orange-700: #c2410c;

  --action-primary-background: var(--palette-orange-500);
  --action-primary-foreground: #1a1a1a;   /* 5.71:1 */

  --text-link: var(--palette-orange-700); /* 5.17:1 on white */
  --text-display-accent: var(--palette-orange-500); /* large text only */
}

The comments are documentation, not proof. Check every pair the system allows in an automated test or a contrast matrix: each text token against each surface it may appear on. A matrix makes forbidden combinations visible, such as the display accent used for a caption.

Name the restriction in the token where you can. A name such as text-display-accent tells the next designer that the color is for large text, before a check has to.

States, focus and links

A component passes in its resting state and then fails on hover, when selected or in an error state. Test each state as its own pair.

What each state needs
StateRule
Hover, pressedText inside still needs 4.5:1 against the new fill.
Selected, checkedThe visual cue that shows the state needs 3:1 against adjacent colors (1.4.11).
FocusThe indicator is state information, so 1.4.11 applies: 3:1 against adjacent colors.
DisabledExempt from contrast minimums. It still has to read as disabled, not as broken.
PlaceholderCovered by 1.4.3. A faint grey placeholder is a common failure.

Two details about controls. First, 1.4.11 does not require a visible border on a button when its text already identifies it as a control. A borderless text button can pass. Second, an input field whose boundary is the only thing that shows where to type needs that boundary at 3:1.

Focus has a stricter, optional level. 2.4.13 Focus Appearance (AAA) asks for an indicator at least as large as a 2px perimeter of the component, with 3:1 between its focused and unfocused pixels. A 2px outline offset from the control in a color that contrasts with the page is a simple way to meet both. Designing a usable keyboard focus path covers where that indicator has to appear.

Links inside running text cannot rely on color alone (1.4.1 Use of Color). Either underline them, or make the link color 3:1 against the surrounding text as well as 4.5:1 against the background. The underline is usually the simpler choice.

Dark mode needs its own pairs

A color that passes on white is not guaranteed to pass on a dark surface. A blue such as #2563eb is 5.16:1 on white but only 3.36:1 on #1a1a1a. Used as link text in a dark theme, it fails.

So the dark theme needs its own values for the same semantic tokens, and its own run of the contrast matrix. Often the light theme uses a deeper step of a hue for text and the dark theme uses a lighter step, while fills can keep the brand’s original value.

Do not derive dark values by inverting. Inversion keeps hue relationships but not luminance relationships, and contrast is entirely about luminance.

A checklist for the system

The ratio is a minimum, not a measure of good design. Thin or very small type can be hard to read at a passing ratio, and a passing palette can still be unpleasant. Within those limits, a system that meets WCAG contrast without losing its color usually does the following:

  1. Documents contrast for pairs, never for single swatches.
  2. Keeps the brand color at full strength where it passes: large type, fills with a suitable text color, dark surfaces, decoration.
  3. Adds a deeper step for small text and links on light surfaces.
  4. Tests every allowed text-and-surface pair, in every theme, without rounding.
  5. Tests hover, selected, error and focus states as separate pairs.
  6. Checks placeholder text and input boundaries, which are often missed.
  7. Underlines links in running text, or meets the 3:1 rule against surrounding text.