Good colour contrast is essential for people to read and understand content. It helps people with different types of vision and makes content easier to read on different devices and in different types of lighting.
Consider if there's enough contrast between the text and the background. Light coloured text on a white background may look nice, but it's difficult to read. To meet accessibility requirements, the contrast ratio between text and background must be at least:
Check contrast early on in the design process and whenever colours are reused in new contexts. To measure the contrast between text and background colours use a tool like WebAIM’s Colour Contrast Checker. Test contrast in all states, including hover, focus, active and disabled states.
Colour contrast also applies to icons, buttons, form fields, charts and other visual elements that convey meaning or require user interaction. The minimum contrast ratio for these elements is 3:1 when they convey meaning or require user interaction.
Make sure keyboard focus indicators have at least a 3:1 contrast ratio. Focus styles should be clearly visible and not rely on colour alone.
Use text over images sparingly. If you must place text over an image, add a solid background behind the text or apply a dark or light overlay to the image to ensure sufficient contrast across all screen sizes.
Text that's part of a logo does not have a minimum contrast requirement. However, when logo or brand colours are reused in content for headings, links or buttons, the text colour must meet contrast requirements. This may involve adjusting the colours or developing a separate set of brand colours to use for text.
Do not use colour alone to convey meaning. Consider if the colour was removed, would people still understand the message? For example, are you using colour alone (such as blue text) to indicate a hyperlink without also underlining it? There must be more than one visual cue. This applies to: