Listen to this blog
According to a survey by WebAIM, low contrast text is the most widely seen bug with regard to accessibility as it is present in 86.3% of the top one million home pages on the web. So despite the different preferences of the users when it comes to font color, the focus should always be on the legibility of the text. Color Contrast Analysis goes beyond the text color as proper contrast levels have to be maintained even in visual elements like graphs, infographics, and interactive elements such as links, buttons, and so on. But how will you determine if the contrast levels used are in line with the standards set by WCAG? We simply can’t take a look at it and come to a conclusion on our own. That is where Color Contrast Analyser comes into play.
So in this blog, we will be explaining to you how to use a Color Contrast Analyser for your testing with a few sample scenarios as well. Even though the process itself is very simple, the effectiveness of using a color contrast analyzing tool comes with the maximum coverage we can attain. So we will also be seeing a general checklist and a few common challenges that you will be facing during your testing.
Why should we use a Colour Contrast Analyzer for Accessibility Testing?
People with visual impairments such as color blindness and low vision find it difficult to identify the difference between certain color combinations like Red-Green, Red-Black, Blue-Yellow, and so on. As a result, if online sites contain text with such color combinations, or if there is a lot of content with small font size on a non-white backdrop, it becomes hard for anyone with visual impairments to see and understand it. So color contrast analyser is an easy-to-use, yet effective tool that will let you know if your choice of color combinations will pass the visibility test.
How to test Color Contrast for Accessibility?
Though there are numerous color contrast analyzing tools available, we always opt to use the Color Contrast Analyser provided by TPGi as it is widely used for accessibility testing by testers. You can download both the Windows and macOS versions by visiting the TPGi website.
So once you have installed the Color Contrast Analyser by following the mentioned steps, you will be able to check if the contrast levels fulfill the success criteria defined by WCAG. We all know that accessibility is measured by the level of compliance (A, AA, & AAA). So the level of color contrast ratio comes under the AA & AAA compliance levels. The specific success criteria that can be used to find out if the text is accessible for sighted people is WCAG 1.4.3. The contrast ratio should be greater than 4.5:1 in order to pass this success criterion from WCAG 2.1. Likewise, for non-text content, the success criteria to comply with is 1.4.11 and the contrast ratio should be higher than 3:1 to pass.
Now that we know what the goal is, the first step would be to check the size of the font and get an idea of whether it will be considered small or large text. If the text size is 18 points (24 pixels), it will be considered large text. And if the text size is 14 points (18 pixels) it will be considered small text. The reason is that there are distinct success criteria for both small and large text.
|Type of Content
|WCAG Success Criteria
|Required Contrast Level for Level AA
|Required Contrast Level for Level AAA
|4.5:1 (Small Text) 3.1(Large Text)
|7:1(Small Text) 4.5:1(Large Text)
|Image Of Text
|Non-Text Content (Link, Graph, Buttons, And So On)
You can easily use the Color Contrast Analyzer by following the below-mentioned steps
- Click on the Color Picker option in CCA.
- Place the picker correctly on the background of the text and click to pick the color.
- Look for the darkest part of the text and pick the color using the tool.
- You can even input the hex codes of the colors you wish to check if you do not want to use the eyedropper tool.
If the contrast levels between the background and text are okay, we will see a green color tick mark in the contrast tool. If not, it will show a red color X mark. The same process can be repeated for all other content such as images of text, links, buttons, radio buttons, and so on.
How to check color contrast on a mobile app?
Since there aren’t any mobile applications that can do the same tasks as the Color Contrast Analyser, you can use the color palette of your app to check the color contrast levels. But if you do not have access to the mobile app’s color palette, one easy alternative is to just take screenshots of the various screens you want to test and transfer them to your computer to test it using CCA. But if your app is large in scale, you might want to use a simulator to get your testing done.
Whichever method you opt to use, you have to keep a few things in mind when it comes to testing color contrast for mobile apps. Though we do not turn on high contrast mode in computers, dark mode & high contrast settings are important as both Android and iOS have recently introduced system-wide “Dark Mode” functionality. So you have to make sure to test the color contrast levels in both the dark and light modes.
It is also tough to judge the text size with just the appearance on mobile devices as they have a broad range of DPI and screen sizes. So make sure you do not presume the text is huge unless you know for sure that it is 18+ pt or 14+ pt bold (24px or 19px bold for online).
- Make sure to test web elements by shifting focus to them, hovering over them, and so on to see if the desired visual indicators such as outline/border creation, or color/background changes.
- Check if the outline or border width is at least 2 px.
- Make sure no meaning is conveyed only by color if there are additional formatting options such as bold, italics, or underline.
- If texts are there in an image, ensure that the font size is at least 16 px to maintain legibility.
- Ensure that pie charts have a gap between each portion to make it possible for people with color blindness to see and understand it clearly. Based on the level of compliance, you can even add labels with arrows to ensure there is no type of miscommunication.
- Since logos and decorative images are exempt from color contrast analysis, you need not waste time worrying about them.
- If there are any outlines behind a text, to make up for the change in the opacity of the text or the luminance of the background, the color of the outline should only be considered as the background color.
- Make sure the ‘High Contrast’ or Night modes are turned off when performing these tests on your computer.
- If any drop-down or flyout vanishes whenever the CCA comes into focus, make sure to take a screenshot of the flyout and then test it using the CCA.
We have used a random website in the below scenarios for our explanation purposes. We will be a success scenario and a failure scenario as it will help you get a clear picture of using a Color Contrast Analyser.
In this scenario, the regular text has failed at the AA level and the large text has failed at the AAA level of the compliance. It is also evident that it has passed only in the non-text contrast testing. As a result, the image will be very hard for visually impaired viewers to view.
Since it is black text on a white background, all the conditions have been satisfied in the color contrast analyzing text.
Though color contrast analysis is a very simple process, the ability to yourself in the shoes of a visually impaired person is the key to attaining the best results. Thanks to our years of experience in providing accessibility testing services to numerous clients, we have a well-trained accessibility testing team that has delivered the best results with maximum coverage. And that knowledge is what has helped us convey such informative content. So make sure to subscribe to our newsletter to stay tuned with Codoid.