New Tool Radar

AI Design Workflows

How to Check Buttons, Icons, and Focus Indicators in an AI Design for Non-Text Contrast

Check the buttons, icons, and focus indicators in an AI-generated design against the 3:1 non-text contrast mark, because a control people cannot see is a control they cannot use.

Schematic diagram: three steps to check non-text contrast — pick the two neighbor colors, work out the ratio, compare with 3:1 — with a practice result of the order button border at 2.16 to 1 failing and the leaf icon at 5.60 to 1 passing.

Text contrast is only half the readability check. An AI-generated design can have perfectly readable words and still be unusable, because the button border is too pale to see, the icon melts into the background, or the focus ring disappears. The W3C’s non-text contrast rule covers exactly those parts: the visual information needed to identify a control and its state.

The 3:1 mark, and what it covers

The W3C says the visual presentation of user interface components and graphical objects must have a contrast ratio of at least 3:1 against adjacent colors. For controls, that means any visual information necessary to identify that a control is present and how to operate it must have a minimum 3:1 contrast ratio with the adjacent colors, and the same applies to the information that shows a state, such as whether a component is selected or focused. The rule does not apply to inactive components, such as a disabled button. And the W3C warns that the 3:1 ratios are threshold values: computed values should not be rounded, so 2.999:1 would not meet the 3:1 threshold.

The problem is stated on the same page: “Low contrast controls are more difficult to perceive, and may be completely missed by people with a visual impairment.” That is the problem this check fixes: a design that looks finished can hide its own controls from the people who need them most.

Check each control against its neighbor, not against the page

For each button, icon, input border, check mark, and focus indicator in the AI-generated design, write down the two colors that sit next to each other — the control’s color and the color directly beside it — and work out their contrast ratio. Compare it with 3:1. A button border is checked against the background outside the button, not against the button’s own fill. A check mark inside a checkbox is checked against the box it sits in. A focus ring is checked against the background it appears on. Do not round the result up: 2.99:1 is a Fail.

Practice non-text contrast check: fictional Maple Corner homepage

The six rows below are fictional practice material. No contrast checker was run on a real design for this guide; the ratios were calculated from the stated hex pairs with the WCAG relative-luminance formula, and each one was verified by re-calculation.

Control Colors Contrast ratio Result
Order button border #E8A33D on #FFFFFF 2.16:1 Fail — below 3:1
Leaf icon #2F6B4F on #F7F1E6 5.60:1 Pass
Focus ring on the order button #26221C on #FFFFFF 15.81:1 Pass
Check mark in the newsletter box #F7F1E6 on #2F6B4F 5.60:1 Pass
Selected star in the rating #E8A33D against #F7F1E6 1.92:1 Fail — state shown by color alone
Disabled button border #C9C2B8 on #FFFFFF 1.77:1 Exempt — inactive components are not required to meet the mark

Three of the six rows pass, two fail, and one is exempt. The two failures are different problems: the order button border is simply too pale against white, and the selected star relies on color alone to show its state — a second indicator, such as a filled shape or a label, is needed as well as a stronger color. The disabled button is not a pass; it is exempt, and it should stay visibly different from the active buttons.

What to do when a control fails

Darken the control’s color, or put it on a background it stands out against — do not just make it bigger, because size does not fix contrast. If a state is shown by color alone, add a second indicator, such as a shape, an icon, or a word. Re-check the focus indicator last, because a design that passes everywhere else can still fail when a keyboard user tabs through it and the focus ring vanishes.

Expected result. We checked the W3C non-text contrast guidance. We did not run a contrast checker on the Maple Corner design; the six ratios were calculated from the stated hex pairs with the WCAG relative-luminance formula.

Limits

This check covers non-text contrast only. It does not check text contrast, which has its own marks of 4.5:1 for body text and 3:1 for large text, and it does not check color-blind safety or whether color alone is used to convey meaning. Thin lines can look fainter on screen than their stated colors suggest, because of anti-aliasing, so a ratio that passes on paper can still look weak in practice. Maple Corner is fictional, and the six rows above are practice material, not a real audit.

Sources

  • Understanding Success Criterion 1.4.11: Non-text Contrast — WAI, W3C — “The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s): User Interface Components [and] Graphical Objects.” Also: “Low contrast controls are more difficult to perceive, and may be completely missed by people with a visual impairment.” And: “The 3:1 contrast ratios referenced in this success criterion is intended to be treated as threshold values. When comparing the computed contrast ratio to the success criterion ratio, the computed values should not be rounded (e.g. 2.999:1 would not meet the 3:1 threshold).”
See all