HIYSL REFERENCE / FIELD NOTES

How to Check Tooltip Text and Background Contrast

In this guide
AI-generated illustration; not taken on location · Illustration of tooltip text and its background connected to a contrast check.
AI-generated illustration; not taken on location · Tooltip text and its displayed background form the pair used for a contrast check.AI-generated illustration

To check tooltip contrast, compare the color of the tooltip text with the background actually displayed immediately behind it. Enter those two colors into a contrast checker, then compare its result with the criterion that applies to the text. If the tooltip is translucent or appears over changing content, check the relevant appearances separately.

The most useful result is one you can connect to a specific tooltip and display state. Keep a short record of where the tooltip appeared, which colors you checked, and which criterion you used. That record makes it easier to understand a borderline result and to verify any changes.

Identify the tooltip text and its background

Start by opening the page or application and revealing the tooltip you want to assess. Use the interaction that normally brings it into view, such as placing the pointer over the relevant item or moving focus to it. If the tooltip disappears before you can inspect it, check whether the application or your inspection method provides a way to keep that state visible. A capture of the displayed state may also help, provided it preserves the colors you need to examine.

Identify the text whose readability you are checking. A tooltip may contain more than one piece of text, so note whether they appear to use different colors or sizes. Treat each distinct text and background combination as a separate check. For example, a short label and a longer explanation may need separate attention if they look different.

Next, identify the background directly behind that text. This is the area inside the tooltip against which the letters appear, not automatically the page background outside the tooltip. If the tooltip has a border or pointer, those areas are not substitutes for the background behind the words.

Obtain a usable color pair

Use a color picker or another inspection method available to you to identify the text and background colors. Record the values in a format your contrast checker accepts. When inspecting a capture, choose a clear part of a letter and a nearby area behind the text; avoid assuming that a pixel at the edge of a letter represents the intended text color. If the displayed text or background varies, record the relevant appearances rather than treating one sample as the whole tooltip.

Before moving on, ask: can I identify which text this pair represents, and was the background sampled from the same visible state? If either answer is unclear, reveal and inspect the tooltip again. If you cannot obtain reliable values, seek a method that can inspect the displayed colors before relying on a contrast result.

Account for transparent or changing backgrounds

A translucent tooltip can look different depending on what is underneath it. The color specified for the tooltip alone may therefore be a poor substitute for the background a reader actually sees behind the text. The practical task is to determine that effective displayed background for each relevant appearance.

First, show the tooltip over the content you want to check. Then inspect the area immediately behind the text in that displayed state. If you use a capture and a color picker, confirm that the capture and picker give you a reliable representation of the displayed colors. Use the resulting background value with the corresponding text color in your contrast check. If you cannot verify the displayed value this way, look for an inspection method that can account for the tooltip and underlying content together; do not assume a checker handles transparency unless its instructions say so.

Check more than one underlying area

Consider where the tooltip can appear in the task you are checking. If it can sit over a light area in one state and a dark area in another, inspect both. If it can appear over an image or a patterned area, look at the different backgrounds that can lie directly behind the words. Record each appearance separately so you can connect each result to the state that produced it.

For example, you might record one pair for a tooltip displayed over a pale part of a page and another for the same tooltip over a darker part. The tooltip’s text may look unchanged, but the background value you need to check may differ. A passing result for one pair does not establish the result for the other.

When the background varies across the text itself, a single sampled color may not represent every word. Inspect relevant areas behind the text and check the resulting pairs. Pay particular attention to areas where the text and background appear least distinct, while avoiding the assumption that appearance alone proves a pass or failure. If you cannot obtain representative values, treat the outcome as unresolved until you can inspect that state reliably.

Check and interpret the contrast ratio

Enter the text color and the corresponding displayed background color into a contrast checker. Check that the values have gone into the intended fields and that they describe the same tooltip appearance. The output to look for is a contrast ratio for that pair. Contrast ratios use relative luminance, so the result is a way to assess the relationship between the two colors rather than a judgment based only on whether they look different.

Before deciding whether the result meets a requirement, identify the criterion that applies to the text you are checking. Text size matters to that decision. Verify the applicable size category and threshold using the guidance or standard relevant to your task; do not guess the category from how large the tooltip looks on your screen. If the tooltip contains text with different sizes, identify the criterion for each relevant piece before comparing results.

Compare the result with the applicable threshold without rounding a value up to make it pass. A result close to the threshold needs particular care: verify the inputs, the displayed state, the text-size category, and the precision available in the checker. If the displayed result does not provide enough precision to make the comparison confidently, use a method that does or treat the result as unresolved.

Keep the result tied to its conditions

A compact note for each check can include the tooltip text, the two color values, the underlying content or state, the ratio, and the criterion used. Add whether the result meets that criterion or needs further investigation. This is especially helpful when similar-looking tooltips appear in several places.

If a checker gives a pass or fail label, make sure you understand which criterion it is applying before relying on that label. For more guidance on color usage and contrast, consult Section508.gov’s guide to making color usage accessible.

Adjust and recheck

If a pair does not meet the applicable criterion, decide which part of the pair you can change. You may be able to choose a different text color, alter the tooltip background, or adjust both. The goal is to find a pair that meets the criterion in the relevant displayed states, while keeping the tooltip readable in context.

If the text color is difficult to change, start by considering the background. If the background needs to remain as it is, try a different text color. Where transparency makes the result depend on the underlying content, consider whether changing the tooltip background or its transparency can make the displayed background more consistent. The right choice depends on the options available in the page or application; if you cannot edit them yourself, give the person responsible the color pair and the states that need attention.

Repeat the check on the displayed result

After making a change, reveal the tooltip again and identify the colors actually displayed. Enter the revised pair into the checker and compare the result with the same applicable criterion. Do not rely solely on the color you intended to select: verify the appearance that readers will encounter, especially when content underneath can affect it.

Recheck each relevant combination you recorded earlier. If the tooltip appears over both light and dark content, for example, test the revised tooltip in both situations. Also check any distinct text colors or sizes in the tooltip using their applicable criteria. A change that improves one combination may leave another needing attention.

Finish by updating your notes with the revised values, results, and states checked. If a result remains close to the threshold, verify its precision and consider a pair with more room above the requirement. If you cannot reproduce an appearance or determine its displayed colors, keep that item open for a later check. Your record should make clear what has been verified and what still needs a reliable measurement.

Sources