HIYSL REFERENCE / FIELD NOTES

How to Check Icon Contrast Against a Background

On this page
AI-generated illustration; not taken on location · Illustration of the same icon against light and dark backgrounds
AI-generated illustration; not taken on location · An icon can appear more or less distinct as its background changes.AI-generated illustration

To check an icon’s contrast, identify the parts that communicate its meaning, find the background colors touching those parts, and compare the colors with a contrast checker. Then consider whether the icon or another visible cue is needed to understand the information or identify a control or state.

A ratio is a useful starting point, but it does not settle every accessibility question by itself. You also need to check the icon in its actual context, including any background that changes behind it, and verify which WCAG criterion and exceptions apply.

Identify what the icon communicates

Start with the icon as a reader encounters it. Ask what someone is expected to understand or do when they see it. An icon might convey information, help identify a control, or indicate a state. Write that purpose in a short phrase before choosing colors to measure.

For example, if an icon appears beside a label, consider what each contributes. Can the label communicate the same meaning on its own? If the icon changes to indicate a state, does another visible cue communicate that state too? An icon may have several parts, and the parts needed to understand it may be different from purely decorative details.

Choose the parts to examine

Look at the outline, internal marks, and any other elements that contribute to the meaning. A useful question is: “If this part disappeared, could I still recognize what the icon is telling me?” Make a note of the parts that appear necessary, then compare those parts with their adjacent backgrounds.

Avoid treating an entire multicolored icon as one foreground color. If different meaningful parts use different colors, make a separate note for each. Also consider whether an icon is understandable without relying on color alone; a visible label or another distinguishing cue may communicate the same information.

This first review helps you decide what to measure and what to investigate in the criterion. It does not replace checking the applicable requirements, especially when you are unsure whether a detail is necessary or whether another cue is equivalent.

Find the colors that meet at the icon

For each meaningful part, identify the foreground color and the background color immediately next to it. The relevant background is the one touching that part in the context you are checking. If an icon sits inside a button, for example, look at the area directly behind the icon rather than assuming the surrounding page is its background.

Record each pair in a small working list. If a dark outline and a colored interior both contribute to the icon’s meaning, they may need separate comparisons. If the icon overlaps more than one background color, note the different areas it touches rather than choosing the most favorable one.

A color picker may help you identify a color when you have an example to inspect. Before relying on it, check what the particular tool accepts and how it reports a selected color. If you already have the color values, keep them alongside a description of where each value appears. That makes it easier to enter the intended pair and revisit it later.

Check the actual context

Consider each version of the icon you need to assess. A color pair observed in one setting may not describe another setting where the background or icon color changes. Keep a separate record for each relevant combination.

If you cannot determine a color with confidence, obtain or verify the value before treating the result as conclusive. You can still make a provisional comparison, but record what you need to confirm: the particular icon part, the area behind it, and the colors used in that view.

Compare the colors

Use a contrast checker to compare the foreground and background colors you identified. The intended inputs are the two color values; the output to look for is their contrast ratio. Check the tool’s instructions for its accepted formats and the way it displays results, since interfaces and available controls can differ.

A practical sequence is:

  1. Select one meaningful icon part and the background area directly adjacent to it.
  2. Enter or otherwise provide the two color values in the checker.
  3. Record the displayed contrast ratio with a description of the pair.
  4. Repeat for other meaningful parts or adjacent background colors you need to assess.
  5. Use the applicable criterion to interpret each result in context.

For instance, your notes might say “icon outline against button background,” followed by the two values and the ratio shown by the checker. Another line could describe an internal mark against the color next to it. Descriptive labels matter when several combinations produce different results.

Read the result in context

A checker gives you a comparison for the colors supplied. Before interpreting the number, confirm that those colors represent the meaningful part of the icon and the adjacent background you intended to test. A correct calculation for the wrong pair will not answer the question you are trying to solve.

The ratio alone also does not determine whether a particular icon is covered by a requirement or an exception. Use it with your notes about the icon’s purpose, other visible cues, and the context in which it appears. If the tool presents a pass or fail message, check which criterion that message refers to before applying it to your example.

Decide whether the result meets the relevant criterion

After measuring, decide whether the WCAG non-text contrast criterion applies to the information or interface cue you are evaluating. Focus on what is needed to understand the graphic or identify the control or state, and consider whether another visible cue communicates the same information without relying on color.

Work through the decision with your notes:

Question What to review
What does the icon communicate? The information, control, or state a reader needs to recognize.
Which parts carry that meaning? The outline, marks, or other elements you identified as meaningful.
Is there another visible cue? Whether it conveys the same information without depending on color.
What did you compare? Each meaningful foreground color and its adjacent background.
What does the criterion require? The applicable requirement and any exception relevant to the example.

Consult the relevant WCAG guidance for the exact requirement, its exceptions, and how they apply to your situation. If you are uncertain whether a cue is equivalent or whether an exception applies, keep that question open while you verify it; do not make the checker’s result carry that decision for you. The Section508.gov color accessibility guidance is a place to begin that review.

Your final note can connect the result to the decision: identify the icon and context, the colors and ratio checked, the meaning the icon carries, and the criterion or exception you verified. This makes the reasoning easier to revisit if the icon, background, or surrounding cues change.

Handle gradients and revise weak combinations

A changing background needs more attention than a single color pair. For a gradient or patterned background, identify the adjacent background color that has the least contrast against the foreground. Compare that area with the meaningful icon color, and keep track of where the comparison applies.

Then consider what happens to the icon’s meaning. Treat parts next to areas with insufficient contrast as invisible and ask whether the icon remains recognizable. This is especially useful when an icon crosses several background areas: a well-contrasted portion may remain visible while another meaningful portion is difficult to distinguish.

Adjust and check again

If a necessary combination has insufficient contrast, consider changing the icon color, the background color, or both. You could also reconsider how the meaning is communicated, including whether another visible cue makes the information clear without relying on color. Choose an adjustment that suits the actual context, then measure the revised colors again.

For a gradient or pattern, repeat the review of the least contrasting adjacent area after the change. Check recognition again as well: an improved ratio for one pair is most useful when the parts needed to understand the icon remain recognizable in the full setting.

Keep both the original and revised notes if they help you compare options. Record the meaningful parts, adjacent colors, ratios, and the criterion you used. If the background or icon can appear in another relevant combination, repeat the process for that combination instead of assuming the first result applies everywhere.

Sources