Use high contrast
Ensure that the colour selection for text and their background colours have a high enough contrast ratio. Table of contents Why should we…
Read more, Use high contrastLast updated on January 01, 2022• A11y issues
You should not rely on colour alone to convey information, as not everyone can see the difference between colours.
1 in 12 UK males are colour blind, often unable to see the difference between green/red.
So if you are trying to indicate if something was a success by just showing a green or red colour (e.g. a border) then it will be very hard for those types of users to understand.
The example below shows a table with users and their online status - but you can only tell they are online if you can see the colour. (This also has screen reader accessibility issues).
See table below for online status of our users:
Tom |
Jerry |
Table legend: online, offline
The example above is trying to tell users that Tom is online (as it has a green background status colour). But for colour blind users (and screen readers) this information would not be conveyed.
Another common way to have accessibility issues with colours is if you have a status icon - such as a round circle - which is coloured red or green.
The example below shows a slight tweak and it is much more accessible:
See table below for online status of our users:
User | Online status |
---|---|
Tom | Online |
Jerry | Offline |
The fixed version could be improved, but this is a very basic change and it is now much more accessible.
Another example of an inaccessible component would be if you had a text input that trys to tell the user about an error, by just having a red border:
<input type="text" style="border:2px solid red" placeholder="some input" />
But this could be fixed by adding an error message next to it (in text).
It is fine to use colour to convey information - as long as there is another way to understand the meaning.
So you could have a red/green border, but also have text explaining what it is.
Or if you have a circle status, it is fine as long as inside the circle there are different icons (e.g. a tick and a cross). Of course, remember to make it accessible for screen readers too.
Please consider sharing this link with your work colleagues or on social media. There are no ads on my site, I just want to promote accessibility.
Found an issue? please point them out - let me know if there is a mistake and I'll update it
Follow me on Twitter: @A11yForDevs. I post links to interesting a11y articles and resources.
Ensure that the colour selection for text and their background colours have a high enough contrast ratio. Table of contents Why should we…
Read more, Use high contrastIf you can make your site usable with just a keyboard then it is likely that other assistive input devices can also use your site so you…
Read more, Support keyboard only access