Tithi MondalBlog

Article6 min readUpdated

Colour Contrast in UI: Make Text Easy to Read Anywhere

Colour contrast in UI explained simply: the 4.5 to 1 text rule, how to use a contrast checker, and how to fix light grey text for sunlight.

Read inहिन्दीবাংলাमराठीதமிழ்తెలుగుગુજરાતી

Colour Contrast in UI: Make Text Easy to Read Anywhere: cover illustration

A founder sends me a screenshot of her app and says, "The design looks clean, but my father cannot read the prices." The prices are light grey on white. On a designer's bright monitor in a dark room they look elegant. On a phone in a shop with the afternoon sun coming through the door, they nearly disappear.

This is a colour contrast problem. Colour contrast in UI means the difference in brightness between the text and the colour behind it. More difference makes text easier to read. Less difference makes the eyes work harder, and in strong light the text vanishes.

What is a good contrast ratio for text?

A common guideline is a ratio of at least 4.5 to 1 for normal text, and at least 3 to 1 for large text. These numbers come from widely used accessibility guidelines. A ratio compares the brightness of two colours. Black on white is 21 to 1. Two identical colours are 1 to 1.

Large text usually means text of about 18 points or bigger, or about 14 points when bold. Icons and borders that carry meaning, such as a text field outline, also need about 3 to 1 against the background.

Here is how this looks in practice:

UseAim forExample
Body text and labels4.5 to 1 or moreDark grey on white
Large headings3 to 1 or moreMedium blue heading on white
Input field borders3 to 1 or moreA clear mid-grey outline
Disabled controlsExempt from the rule, but still legible enough to understandGrey button with readable label

These are general guidelines, and some projects aim higher. Treat 4.5 to 1 as the floor, not the goal.

Why is light grey text such a problem?

Light grey text is popular because it looks quiet and modern, but it often fails the 4.5 to 1 rule. The most common failure is placeholder text, captions, timestamps and "secondary" labels set in a very pale grey.

Suppose a food ordering app shows the restaurant name in dark text and the delivery time in pale grey. The delivery time is the thing the hungry user wants most. Making it the weakest element on the screen is a design mistake.

Do this instead:

  • Do use a dark enough grey for secondary text. Reduce emphasis with size or weight first, not only with lightness.
  • Do not make important facts, like price, date or delivery time, the lightest text on the screen.
  • Do not use pale grey placeholder text as the only label of a field. See form design best practices.

If the text matters, it must be readable. If it does not matter, remove it.

How do I check contrast with a contrast checker?

Use a contrast checker, which is a tool where you type two colour codes and it gives you the ratio. Many free ones exist, and several plugins work inside Figma. Search for "contrast checker" and choose one you trust.

The steps:

  1. Take the text colour hex code, for example the code for your grey.
  2. Take the background hex code.
  3. Enter both and read the ratio.
  4. If the ratio is below 4.5 to 1 for body text, darken the text or lighten the background.

If hex codes are new to you, my guide on colour codes explained covers them.

Check contrast in every state, not only the default one. Common misses:

  • Text on top of photos, where the background changes across the image.
  • White text on a bright button, such as yellow or light green.
  • Text inside a disabled or selected state.
  • Dark mode, where colours that pass in light mode may fail. See my dark mode UI design guide.

What about sunlight readability?

Sunlight readability is how well a screen can be read in bright outdoor light. Sunlight washes out a phone screen and reduces the contrast people see. Text that passes a checker at 4.5 to 1 can still be hard to read outside, especially on a cheaper phone with a dimmer screen.

India has many outdoor and semi-outdoor situations: a farmer in a field, a rider on a road, a vendor at a stall, a student on a rooftop. Many of these people use mid-range Android phones. For them, I design with extra margin.

Practical steps:

  1. Go above the minimum for the most important text. Aim for 7 to 1 on prices, balances and key instructions where possible.
  2. Prefer dark text on a light background for outdoor-heavy apps. A light theme usually survives sunlight better than a dark one.
  3. Use a medium or bold weight for key numbers. Thin fonts lose strength in glare.
  4. Test the real screen outside. Walk into the sun with a mid-range phone and look at your design.

I wrote about similar real conditions in designing for low-end phones and slow networks. On an agritech app I designed, I thought about farmers reading screens in open fields, and that shaped how strong the text and buttons needed to be.

Do I need colour to carry meaning?

Colour should never be the only way to show meaning. Many people, men in particular, have some form of colour vision difference. A red error message and a green success message can look the same to some people.

Combine colour with another signal:

  • Do add an icon and a text label to errors: a red outline plus a warning icon plus the words "Enter a 10 digit mobile number".
  • Do underline links in body text, or give them a clear style beyond colour.
  • Do not show order status only with a red dot and a green dot.
  • Do not use a red line chart and a green line chart with no labels.

For how this ties to error design, see empty states, loading and error screens. For the full picture of inclusive design, see accessibility in app and web design.

How do I build contrast into a colour palette?

Build contrast into the palette from the start, so you do not fix it screen by screen later. A palette should include a set of text colours and background colours that are already checked as pairs.

A simple approach:

  • Pick one dark text colour for body text, and test it on every background you use.
  • Pick one muted text colour for captions, and test it too. It must still pass 4.5 to 1.
  • Pick a brand colour for buttons, and test the label colour on it. White text on a light brand colour often fails, so use dark text or darken the brand colour.
  • Write the approved pairs into your design system. See design system for startups.

Brand colours are chosen for feeling, which I cover in colour psychology in branding. Contrast is chosen for function. A good palette serves both, and sometimes the brand colour must be adjusted a little so text can be read.

If your current screens have pale text or weak buttons, a UX audit will find them quickly, and I can help fix them through UI/UX design.

Frequently asked questions

What is the WCAG contrast ratio for text?

+

The widely used guideline asks for at least 4.5 to 1 for normal text and 3 to 1 for large text. Some projects aim higher for key content.

Can I use light grey text for placeholders?

+

You can, but it often fails the 4.5 to 1 guideline and is hard to read. Use a field label above the input, and keep placeholder text dark enough to read.

Is a dark theme better for contrast?

+

Not automatically. Dark themes can have good contrast, but light themes usually hold up better in strong sunlight. Check both themes with a contrast checker.

How do I test colour contrast on a real phone?

+

Open the design on a mid-range phone, turn the brightness to a normal level and stand in daylight. If you must squint at a price or a label, increase the contrast.

Working on something like this?

Tell Tithi what you are planning. You get a clear scope, a fixed price and a timeline before any work begins. I reply to every enquiry within 24 hours.

Your details go only to Tithi and are used only to reply to you. No newsletters, no sharing.