StoicBuilder

HandbookVI the AtriumColour and contrast

VIthe Atrium, Design the experience

Colour and contrast

1 min readUpdated 28 November

In plain words

Contrast is how strongly text stands out from its background, and the web's accessibility standard, WCAG, asks for a ratio of at least 4.5:1 for body text.

Where you see it

Light grey hint text on a white form, or white text on a pale brand colour, that's hard to read on a phone in sunlight. In Chrome DevTools, click a colour swatch in the Styles pane and the picker shows the contrast ratio with a pass or fail mark.

src/styles.cssbrowser
.hint { color: #9ca3af; } /* 2.5:1 on white: fails */.hint { color: #6b7280; } /* 4.8:1 on white: passes for body text */
Two similar greys, and only one is readable for everyone.

What goes wrong

  1. Colour as the only signal

    A red border alone tells someone with red-green colour blindness nothing, and about 1 in 12 men have some form of it. Add an icon or a message that says what's wrong.

  2. Trusting your own screen

    A bright laptop at full brightness makes pale grey look fine. Check the ratio, not your eyes.

  3. White text on a mid-tone brand colour

    Many greens, oranges and light blues fail 4.5:1 with white text on top. Darken the button colour, or put dark text on it.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Check every text and background colour pair in our theme against WCAG AA: 4.5:1 for body text, 3:1 for large text and for the borders of inputs and buttons. List the pairs that fail with their ratios, and suggest the nearest passing colour for each.

Quick check

Sign in to earn +10 XP for it

Quill marks a note that failed to sync with a small red dot and nothing else. Who might miss it?

Got a prompt that touches colour and contrast?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.