HIYSL REFERENCE / FIELD NOTES

How to Check Error Message Colors for Readability

On this page
AI-generated illustration; not taken on location · Illustration of error text on a contrasting background beside a warning symbol
AI-generated illustration; not taken on location · Error text, its background, and a visual cue illustrated together.AI-generated illustration

To check whether an error message is readable, compare the color of the error text with the color directly behind it. Use those two colors in a contrast checker, then compare the result with the accessibility criterion that applies to the text. If the form presents the message on more than one background, check each combination.

A readable color pair is only part of a useful error message. Someone should also be able to recognize that there is a problem and understand what to correct without depending on color. The steps below help you record the right colors, make sense of a check, and review the message in the form where it appears.

Identify the error text and its background

Start by displaying the form state in which the error actually appears. Look at the message itself and identify the background immediately behind the letters. Those are the two colors to compare. The color of a nearby border or the general color of the page may be useful to note, but neither is a substitute for the background behind the text.

For example, if an error message appears inside a tinted notice, compare the text with that tint. If another error appears directly on the form’s background, treat that as a separate pair. Even when the same error text color is used in both places, the two checks can produce different results because the backgrounds differ.

List the states to check

Consider the versions of the form a reader may encounter. Does the message appear on a different background in another relevant state or display setting? Is an error shown both beside a field and in a separate notice? Make a short list of each distinct text-and-background combination you can observe. Include a note describing where each pair appears so you can find it again later.

What to record Example note
Error text color The color used for the message beside a field
Background color The color directly behind that message
Form state The state in which that pair appears
Other occurrences Any other message using the pair

Obtain the color values using a method available to you, such as checking the values supplied with the form or using a color picker if one is available. Confirm how that method identifies colors before relying on the result. If you cannot establish the color behind the letters, resolve that first; a check using an assumed background may answer the wrong question.

Keep the message visible while you record the pair. A useful final question at this stage is: “Am I comparing the text people need to read with the surface on which they will actually see it?”

Check the color pair

Use a contrast checker to compare the recorded text and background colors. Before entering anything, look at the checker’s instructions or interface to find out how it accepts colors, how it identifies the two inputs, and how it presents the result. Tool controls vary, so follow the directions for the checker you have chosen.

Enter or select the error text color and the background color in the appropriate inputs. Then read the reported contrast ratio and any accompanying assessment. Contrast ratios use relative luminance; for this task, the practical point is that the result concerns the particular two colors you supplied. It does not automatically establish that every other message or form state is readable.

Interpret the result

Determine which accessibility criterion applies to the error text you are checking. Consult the relevant accessibility guidance for that criterion and compare its requirement with the ratio. If the checker offers an assessment, confirm which criterion it is evaluating before treating the assessment as the answer for your message.

If you are unsure which criterion applies, note the ratio and the details of the text, then check the applicable guidance or ask someone responsible for accessibility to help interpret it. A ratio on its own is a measurement; the decision depends on the requirement you are checking against.

Record the result beside the pair and form state you identified earlier. For each entry, note the criterion used and whether the pair meets it. This makes it easier to distinguish a pair that needs a change from one that has already been checked. If a checker displays information you do not understand, consult its instructions before drawing a conclusion.

Repeat the process for every distinct pair on your list. For instance, a message on a tinted notice and the same message color on the main form background need separate entries and separate checks. If two occurrences use the same text and background colors, record both locations so you can revisit them when reviewing the form.

The immediate decision is straightforward: keep a pair under consideration if it meets the applicable criterion, or identify it for adjustment if it does not. Either way, review the message in context before considering the task complete.

Adjust and retest

When a pair does not meet the applicable criterion, choose an alternative color and check the new combination. You may be able to change the error text color, the background, or both; what is practical depends on the form and the choices available to you. Record the proposed change so you can compare it with the original.

Change one choice at a time when that helps you understand the result. For example, keep the background the same while considering a different text color, then enter the new pair into the checker. If changing the background is also an option, check that combination separately. Do not assume that a color that works on one background will meet the same requirement on another.

Check the whole set again

Return to your list of relevant form states. If one error text color is used on several backgrounds, test the proposed color against each of them. If you change a background, check the error text that appears on that background. Record the new ratios and the criterion used for each decision.

A simple comparison can keep the work organized:

Pair Result to record Next decision
Original text and background Ratio and applicable criterion Keep or adjust
Alternative text and original background Ratio and applicable criterion Compare with the original
Alternative text and another relevant background Ratio and applicable criterion Confirm whether the alternative works there too

After the numerical checks, look at the message in the form. Can you locate it, read the full wording, and tell which field or action it concerns? Review each relevant state, including any location where the background differs. If the proposed change makes the message difficult to follow in context, revisit the wording or presentation as well as the color pair.

Keep a record of the final pairs and where they appear. If the form later uses a different error color or background, repeat the relevant check with the new values. The earlier result applies to the pair you tested, so it is useful as a record rather than as a substitute for checking a changed pair.

Make the error clear without color alone

A message should communicate the problem even when its color is not the clue a reader uses. Pair the color with another visual cue, and write the message so it identifies what needs attention. A warning symbol beside a clearly worded message is one possible combination; the words should still explain the issue rather than leaving the symbol to do all the work.

Compare a vague message such as “Invalid” with a more useful instruction such as “Enter an email address.” The second gives the reader an action to take. The right wording depends on the form and the actual problem, so make sure the instruction matches what the person can correct. Avoid promising that a particular entry will work unless you know the form accepts it.

Review the message as a reader

Look at the error alongside the field or action it concerns. Ask yourself:

  • Can I tell that something needs attention without using the message color as the only clue?
  • Does the wording identify the problem or the field involved?
  • Does it tell me what to do next in terms I can understand?
  • Is the additional visual cue recognizable alongside the words?
  • After making the suggested correction, can I understand what to check next if a message remains?

If a form presents more than one error, review each message separately. Similar-looking messages can still need different instructions: one might ask for a missing answer, while another might explain that an answer needs to be changed. Use wording that helps the reader distinguish the actions instead of repeating a generic warning everywhere.

Finally, bring the checks together. Confirm the text-and-background pair for each relevant state, compare every result with the applicable criterion, and read the message in context with its additional cue. If you cannot change the form yourself, share the recorded pairs, results, locations, and suggested wording with the person who can make the changes. That gives them a concrete starting point and makes the revised message easier to check again.