Contrast of user interface components

Make sure graphical and interactive components have sufficient contrast.

On this page

Overview

What you need to do

Make sure all user interface components have a contrast ratio of at least 3:1 against adjacent colours. This includes buttons, form fields, icons, and other interactive elements. Focus indicators and state changes must also meet contrast requirements so users can identify what’s selected or active.

Meeting the Web Accessibility Standard

When meaningful graphical objects, the important visual aspects of user interface components, and their states meet minimum contrast requirements, this meets WCAG 2 Success Criterion 1.4.11 Non-text Contrast (Level AA).

Why this matters

Poor contrast makes interface elements invisible or difficult to see for users with low vision, colour blindness, or anyone using devices in bright sunlight. When buttons, form fields, or element states lack sufficient contrast, users cannot tell what’s interactive or where they are in the interface.

When this applies

When you need sufficient contrast

When contrast requirements are more flexible 

When to exceed minimum requirements 

Design

Note: Both Android and iOS devices have platform-level focus indicator settings for screen reading. iOS devices also have platform-level focus indicator settings for keyboard. The user can choose from a set of colours and make the focus indicator bolder or have higher contrast.

Review your design system to make sure elements work with these user options, without needing the user to switch settings midway. Users want to set up their focus options once and use them system-wide.

For example, a blue button with a blue focus indicator will not have sufficient contrast, but it may work with a different focus configuration.

Checklist for accessible UI contrast 

Design resources 

For guidance on colour contrast for graphical or interactive elements, read Contrast for non-text content — Knowledge Area: Colour and contrast.

See also the design guidance on accessible UI contrast for each platform:

Development

Here are the key techniques and code examples for implementing accessible orientation support in mobile apps.

iOS implementation
Android implementation

For technical documentation on accessible non-text contrast, read:

For a complete guide on Android app accessibility, see Make apps more accessible — Android Developers.

Testing

Quick test 

These quick steps will help you verify that graphical and interactive elements have sufficient contrast.

  1. Take screenshots of your app in both light and dark modes
  2. Use contrast checking tools — measure contrast ratios of foreground against background colours
  3. Test in bright sunlight or simulate with high device brightness
  4. Enable high contrast mode in accessibility settings
  5. Test with colour filters enabled (simulate colour blindness)
  6. Check focus indicators — are focus indicators clearly visible when navigating?
  7. Verify state changes — can you identify when elements are selected or pressed?

Automated testing 

Check for colour contrast issues with the platform accessibility testing tools:

Testing colour contrast

If you have direct access to the colour codes used in the app, that is preferred. Otherwise, load the app in a simulator or take snapshots and email them to yourself, then use a eye-dropper tool to find the colour codes used.

Enter the foreground and background colour codes you have into a contrast checking tool.

Note: Checking colour contrast using screenshots from devices and sampling tools can be inaccurate. You are unlikely to get the exact value used in the app's code. This can result in false failures. It can be more valuable to perform static testing of colours in the design phase, then have developers use user interface snapshots and unit tests to verify the right colour values for elements against the design.

For a list of contrast checking tools and more on testing contrast, read Test for sufficient contrast — Knowledge Area: Colour and contrast.