HIYSL REFERENCE / FIELD NOTES

How to Darken a Background for White Text

On this page
AI-generated illustration; not taken on location · Illustration of white text on progressively darker color swatches.
AI-generated illustration; not taken on location · A conceptual progression from lighter to darker backgrounds behind white text.AI-generated illustration

To make white text meet a contrast target, first check it against the actual background color behind the letters. If the pair falls short, make the background a little darker and check the new pair. Repeat until you find a color that meets your target while still working for your design.

The target depends on the text and the accessibility requirement you are following. Start by identifying both, then keep a record of your starting color, each useful candidate, and the final result. If the background varies, you will need to consider more than one color behind the text.

Identify the colors and the text’s context

Start with the color directly behind the white letters. A page or graphic may contain several similar shades, so identify the one used in the specific place you want to improve. If you have the color value, write it down. If you need to find it, a color picker may help you identify a color to check; confirm that the value corresponds to the area behind the text.

Keep the text color fixed as white throughout the process. If the text only appears white but has a different color value, use its actual value for the check. Contrast ratios use relative luminance, so the colors being compared matter. A result for a different shade of text or background does not establish the result for your pair.

Next, note what the text says, its size, and its purpose. A short label and a long paragraph may call for different decisions about readability, and the accessibility requirement you follow may treat text contexts differently. Record enough detail to identify the text when you select a target and review the result later.

For example, if white words sit on a colored banner, focus first on the banner color directly under those words. If the banner also contains other colors, avoid assuming that checking one of them covers every area. Make a separate note of any text that sits over a different color or over a background that changes.

Choose the applicable contrast target

Before changing the color, decide which contrast target you need to meet. Consult the accessibility requirement that applies to your work, taking the text’s size and purpose into account. If you are working to a brief or an established design standard, check whether it specifies a target or identifies a requirement you should follow.

Distinguish the applicable minimum from any enhanced goal you want to use. The minimum is the threshold you have determined applies to the text; an enhanced goal is a more demanding target you may choose or be asked to meet. Write down the target and the reason for choosing it, so the result can be evaluated against a clear decision rather than a guess.

If you are unsure which threshold applies, review the relevant requirement or ask the person responsible for accessibility on the project. Give them the text’s size and purpose, and explain where it appears. Do not choose a number solely because it appears in an example for a different kind of text.

A ratio is useful for making a decision, but it is not the whole readability review. For instance, a 4.5:1 ratio does not guarantee that text will be clearly readable in every case. Once a candidate meets the target you have selected, look at the text in its intended context and consider whether a stronger contrast would make it easier to read.

Check the starting color

Use a contrast checker to compare the actual white text color with the original background color. Enter the pair in the form the checker accepts and read the reported contrast ratio. Check that you have entered the text and background values you intended to compare before using the result.

Write down three things: the original background value, the reported ratio, and your selected target. This gives you a baseline for judging each change. It also lets you return to the original color if you want to compare alternatives or if a later adjustment changes the appearance more than you intended.

Compare the reported ratio with your target. If it meets or exceeds the target, you can keep the starting color and move on to reviewing it in context. If it falls short, use the result as your starting point for darkening the background. There is no need to guess how much to change it before you have this first measurement.

A simple working record can look like this:

Check Background value Ratio Decision
Starting pair Your original value Checker result Keep or adjust
First candidate Your revised value Checker result Keep or adjust
Final choice Your selected value Checker result Record and review

These are spaces for your own values, not preset results. If you cannot identify the original color reliably, resolve that first: a precise-looking ratio for the wrong background will not answer your question.

Darken and check in small steps

Make a small change to the background color, keeping the text white. Then compare that candidate with the same white text in the contrast checker. Record the candidate and its ratio alongside the starting result. If it still falls short of your selected target, darken the background a little more and check again.

Continue one candidate at a time. After each check, ask two questions: does the pair meet the target, and does the background still look suitable for its intended use? This gives you a clear decision at each step and makes it easier to find a passing color that remains close to the appearance you want.

Use the results to guide the next change

If a candidate falls short, keep its value as a reference and try a darker version. If a candidate meets the target and looks suitable, retain it as your first passing option. You do not have to continue darkening simply because a darker color is possible.

If the first passing option looks too different from the original, compare it with the last candidate that fell short. You can try another color between those choices and check it against white. Keep the passing option available while you explore; every new candidate needs its own check before you rely on it.

For a practical example, imagine a white label on a colored background. The initial pair falls short of the target you chose. You try a slightly darker background and check it; that candidate also falls short. A second darker candidate meets the target and still suits the label, so you save its value. The actual values and number of steps will depend on your colors and target.

Change only what you intend to evaluate. If the text color also changes, the result describes a different pair. Likewise, avoid relying on a visual impression alone: use the checker result to decide whether each candidate meets the chosen threshold.

Keep and review the result

Record the final background value, the white text value, the reported ratio, and the target you used. Save them wherever you keep the design’s color decisions, such as a project note or shared color list. Include enough context to distinguish this choice from similar colors used elsewhere.

Review the chosen color with the text in place and alongside the surrounding design. Check whether the text is comfortable to read and whether the background still serves its purpose. If you decide to change the background again, check the revised pair rather than carrying over the earlier result. A passing ratio belongs to the colors that were actually compared.

When the background varies

An image, gradient, or pattern can put different colors immediately behind different parts of the text. Check the colors behind the letters, not just one representative color elsewhere in the background. Consider the full area the text can occupy, including any positions where the background changes. If you cannot identify the relevant colors or maintain the selected target across that area, consider using a consistent background behind the text and check that pair.

Before finishing, ask yourself: Is the recorded color the one actually behind the white text? Does the checked pair meet the applicable target? Have I reviewed any other background areas the text uses? A clear record and a final review make it easier to use the same decision consistently later.