Editorial team ·

Can you read that button in daylight? A simple contrast test

Editorial cover: Can you read that button in daylight? A simple contrast test
AI-generated illustration.

On a sunny platform, you can see the pale card on your phone. You have to lean closer to read the blue-grey button. Back at your desk, start with the two colours the browser actually draws. A number gives the designer a better place to start than “make the button less washed out.”

Take the colours from the screen you have

Inspect the label and the surface immediately behind it. In the example below, two greys sit on white. The first grey, #767676, is about 4.54 to 1 against white. That clears the 4.5 to 1 minimum for regular-sized text in WCAG 2.2 at Level AA.

The second grey, #888888, is about 3.54 to 1. On a plain white background it misses that regular-text threshold. Try a darker swatch and measure again. If the actual button sits on an image or changes colour over a gradient, check the weakest part of the text background.

Open the hovered and focused versions. A dark button that passes at rest can become harder to read if its label lightens when you move the mouse over it. Include the screen and the state in your note.

If you work from design files, put the approved pair in the component so it carries through to the next screen. Retest the implemented version with the same pair and your original daylight example.

Example text colours against pure white
Text colour Ratio, approximately Regular text at Level AA
#767676 4.54 to 1 Meets the minimum
#888888 3.54 to 1 Below the minimum

Check the quiet states as well

  1. Find the actual colour pair
    • Open the browser inspector or sample an opaque area.
    • Write down which state and surface you tested.
  2. Measure and retest
    • Compare the result with the criterion for that text size.
    • Run the check again after the change ships.

Questions and answers

Can I round 4.49 up to a pass?
Use the calculated result for the threshold. 4.49 to 1 falls below 4.5 to 1.
What about large text?
WCAG uses a lower minimum for text that meets its definition of large-scale text.
Does legible text prove the focus outline is visible?
Check the label and the focus indicator separately. They help with different parts of the task.

W3C WCAG 2.2: Contrast (Minimum)