Colour can be a useful way to highlight information, but colour should not be the only means of communicating important information.
Do not rely on colour alone
Keep in mind that some people may not be able to distinguish between the colours you have used so it is recommended to use another visual or text cue as well. For instance, if you were to print the information in black and white, would it still make sense?
Instead of:
“Fields in red are required.”
Try:
Include the text “Required” where needed, and use colour as an extra visual cue.
Instead of:
Showing correct fields in green and errors in red with no other information.
Try:
Use clear success and error messages as well as colour.
Contrast basics
To satisfy the required WCAG 2.2 Level AA criteria, normal text generally needs a contrast ratio of at least 4.5:1 against its background.
Reviewing colours
- Check the contrast of text placed on solid colours, gradients and images
- Check links, buttons and other controls in different states, including focus, selected and active states
- Use text or symbols as well as colour to identify important information
- Label errors rather than showing them only with a red border
- Mark required fields clearly rather than relying only on a coloured indicator
- Give charts and graphs labels, patterns or markers as well as different colours
- Make selected or active items identifiable through more than a colour change
- Make links recognisable without just relying on a subtle colour difference
Colour contrast checkers
- Use a recognised contrast checker to compare the foreground and background colours:
- Chrome extension: Colour Contrast
- Browser-based: WebAIM Contrast Checker
- Desktop: Vispero Colour Contast Analyser
- Chrome extension: Colour Contrast