HIYSL REFERENCE / FIELD NOTES

How to Compare Text Contrast in Light and Dark Modes

On this page
AI-generated illustration; not taken on location · Conceptual side-by-side diagram showing primary and secondary text on light and dark backgrounds.
AI-generated illustration; not taken on location · Compare each text role with its immediate background in both themes.AI-generated illustration

To compare text contrast in light and dark modes, check the actual text and background colors for each reading task separately. Start with primary text, then repeat the process for secondary text in both themes. Record each contrast ratio alongside the colors and text role it represents, so you can see which pairings need attention.

A useful comparison does more than pick a winning theme. It helps you identify a label, description, or other piece of text that may be harder to read, check the accessibility criterion that applies to it, and decide what to do next. If you can change the colors, retest after each adjustment. If you can only choose an appearance setting, use the results to help choose the option that works best for you.

Identify the pairs to compare

Begin by choosing a screen or reading task you use often. Look for the main text you need to read and the supporting text around it. Primary text might be the main wording in a message or article; secondary text might include a description or other supporting label. Use the roles that make sense for the interface you are checking.

For each role, identify the background directly behind the letters. Then switch themes, if that option is available, and identify the corresponding text and background again. A single screen can contain several backgrounds, so the main page background may not be the one behind every piece of text. Record a separate pair wherever the text or its immediate background differs.

A simple worksheet keeps the comparison manageable:

Theme Text role Text color Immediate background Contrast ratio
Light Primary Record value Record value Record result
Light Secondary Record value Record value Record result
Dark Primary Record value Record value Record result
Dark Secondary Record value Record value Record result

Add rows for other combinations you encounter. For example, if supporting text appears on a different background in another part of the screen, give it its own row. Note where you found each pair so you can return to it after making a change.

Keep the comparison consistent

Compare the same role in the same context across themes whenever possible. If the primary text in one row comes from a message, use the corresponding message text for the other theme. This makes the results easier to interpret and helps you avoid comparing unrelated elements.

If you cannot find a matching element in both modes, keep the available result and describe the difference in your notes. You can still evaluate that individual pair, but it will not be a direct comparison of the same role in the same context.

Collect and check the colors

A contrast ratio is based on relative luminance, so check the actual text and background colors rather than relying on how light or dark they appear. Enter the two values for one row into a contrast checker, record the resulting ratio, and repeat for the remaining rows. Keep the text and background values with each result: a ratio is useful only when you know which pair it describes.

How you obtain the values depends on the interface and the tools available to you. If the application provides color values, record the values used for the relevant text and background. If you have access to a color picker, check whether it can provide the values you need for that interface. A person who manages the interface may also be able to supply them. Before using any tool, verify what it accepts and what it reports; the steps and available controls can differ.

Work through one pair at a time

For a primary-text row in light mode, locate the text and its immediate background, then record both values. Check that the values correspond to the right elements before submitting them to your chosen checker. Write down the returned ratio beside that row, then repeat the process for secondary text. Switch to dark mode and do the same for the corresponding roles.

If a tool offers more than one input or result, confirm which one is relevant to the colors you are comparing. You do not need to guess at a control’s purpose. Use the tool’s own guidance, or choose another way to obtain the values if the output is unclear.

Some backgrounds or visual states may make it difficult to determine a single pair of values. In that case, note the specific text and background you want to assess and seek a method that can identify the colors relevant to that situation. Avoid treating a guessed value as a measured result.

If you cannot obtain the actual colors, you can still note which text is difficult to read and where it appears. Keep that observation separate from a contrast-ratio result until you have values to check.

Interpret results for each text role

Once your worksheet has results, compare primary text in light mode with the corresponding primary text in dark mode. Then make the same comparison for secondary text. Look for the lower result within each matching pair of rows, and scan the full worksheet for the weakest recorded pairing. This shows you where to investigate first; it does not, by itself, tell you whether every other row meets an accessibility requirement.

Interpreting a ratio also requires knowing which colors were measured and which WCAG criterion applies to the text. Check the applicable criterion for the particular text you are assessing before deciding whether the result meets it. Keep that decision beside the result in your notes, including enough context to remember what was checked.

Read the results in context

A theme can perform differently for primary and secondary text. For example, your worksheet might show that the main text compares well across the two modes while a supporting label has the weaker result in one of them. Investigate the label’s own colors and applicable criterion instead of assuming that the result for the main text covers it.

Also consider the reading task. A pairing that draws your attention as difficult to read deserves another look, even if you have already checked another part of the screen. Return to the exact text and background you recorded, verify the values, and review the result against the criterion that applies.

If the checker presents an assessment as well as a ratio, confirm what text and criterion that assessment refers to before relying on it. If the tool does not make that clear, use the recorded ratio and the relevant criterion to guide a separate check.

Your notes can answer three useful questions: Which theme has the weaker result for this role? Which individual pair should be reviewed first? And is the result being judged against the right criterion? Answering all three gives you a more useful comparison than naming one theme as universally better.

Adjust and compare again

Start with a pairing that has a weak result or is difficult to read. If the interface lets you change its colors, consider adjusting the text color, the background color, or both. Record the new values and check the pair again. Compare the new ratio with the earlier result and review it against the applicable criterion before deciding whether the change has helped.

Make changes you can track. For example, change one color, record the result, and then decide whether a further adjustment is needed. If you change both colors at once, record both new values so you know exactly which combination produced the result. Keep the earlier row or note alongside the new one; it provides a useful point of comparison if you want to try another option.

Recheck everything affected

A color change can affect more than the row you started with. If the same background is used behind primary and secondary text, check both roles after changing it. If a text color is used against more than one background, check each of those combinations. Include the corresponding rows in the other theme whenever your change also affects them.

Return to the screen and review the relevant reading tasks as well as the recorded ratios. Confirm that your notes still describe the text and backgrounds you intended to assess. If a new combination is difficult to read, add it to the worksheet and check it separately.

If you cannot change individual colors

Some readers may only be able to choose among an application’s available appearance or contrast settings. If those choices are available, compare the relevant text and background pairs under each setting you are considering. Use the results and your reading experience to choose the option that best supports your task.

If none of the available choices works well, keep a concise record of the screen, text role, setting, and difficulty. Where a way to give feedback is available, those details can help explain the problem. You can also revisit the comparison if the available settings or interface colors change later.