Website design

The role of colour contrast in web accessibility

Understanding colour contrast is crucial for making websites accessible to everyone, including those with visual impairments. This post delves into the role of colour contrast in web accessibility, exploring how it impacts readability, user experience, and compliance with guidelines like the WCAG.

Updated on:
October 11, 2024
Colour swatches for website accessibility
Contents

What Is colour contrast in web accessibility?

Understanding colour contrast

At its core, colour contrast refers to the difference in brightness between two colours. It’s essential for readability, particularly when it comes to text and background colours. Imagine reading a book printed in grey ink on a light grey page—straining, right? That's what poor contrast feels like for many users on the web. Proper colour contrast makes text legible for everyone, especially those with visual impairments like colour blindness or low vision.

The importance of colour contrast

Colour contrast isn't just about making things look good; it's about making them accessible. When contrast levels are too low, users with vision impairments can find it nearly impossible to read text or identify interactive elements. Imagine trying to read a book in dim lighting—no matter how interesting the story, the poor lighting makes it frustrating. For web users, a similar experience occurs when text blends into the background. Proper contrast helps everyone, from users with colour blindness to those browsing in bright sunlight.

How does colour contrast affect users?

Users with colour blindness

One common visual impairment that benefits greatly from proper colour contrast is colour blindness. There are several types of colour blindness, but they all affect how individuals perceive colours. Imagine trying to tell the difference between a red button and a green one when they both appear as shades of grey. This can be a daily challenge for users with certain types of colour blindness. Good colour contrast makes it easier for them to distinguish between different elements on a page.

Colour blindness affects around 8% of men and 0.5% of women, making it a common condition that should be considered in design. Using colours that contrast in brightness, not just hue, is key. For example, red and green might look different to most people, but they can appear identical to someone with red-green colour blindness. Designing with alternative indicators like patterns or text labels is like adding subtitles to a film—it makes sure everyone understands the message, no matter how they perceive it.

Low-vision users

Low-vision users often have difficulty distinguishing details, especially if colours are similar in tone. For example, a light blue text on a white background might look like a blank space to them. It’s akin to trying to read a menu in a dimly lit restaurant—if the print is too light or the background too bright, the struggle is real. By increasing the contrast between text and background, designers can help users with low vision navigate content with ease.

Low-vision and high-contrast mode

Users with low vision often rely on high-contrast modes provided by their devices or browsers. Websites should be designed to adapt well to these settings, ensuring that content remains visible. High contrast modes can invert colours or increase contrast for better readability, so testing your website with these settings enabled can reveal potential issues. Think of it as testing a product under different conditions—it ensures that no matter how users interact with your site, they have a seamless experience.

The science of colour contrast - contrast ratios

The Web Content Accessibility Guidelines (WCAG) introduce contrast ratios to quantify contrast between text and background colours. This ratio compares the relative luminance of the text colour against the background colour. For example, black text on a white background offers a ratio of 21:1, which is highly readable. The ratio ranges from 1:1 (no contrast, like white on white) to 21:1 (maximum contrast, like black on white). According to WCAG 2.1, the minimum contrast ratio is 4.5:1 for regular text and 3:1 for large text. This ensures readability for users with moderately low vision without relying on assistive technology. Think of this as adjusting your car’s headlights—too dim, and you can’t see the road ahead.

Common mistake: light grey text on the white background

One common design mistake is using light grey text on a white background. While it might look modern and sleek, it often fails the contrast test, making the content difficult to read for many users. A simple tweak to a darker grey can make the text much more readable while maintaining the desired aesthetic. It’s like swapping sunglasses for reading glasses—you’re not changing your style drastically, but you’re definitely seeing more clearly.

Colour contrast in different web elements

Text and background

The contrast between text and background is perhaps the most crucial aspect of web accessibility. If the text blends into the background, users with vision impairments will struggle to read it. For example, light pink text on a white background might look pretty, but it’s not practical for many users. Increasing the contrast by using a darker shade ensures the content is more readable for everyone, much like turning up the volume in a noisy room to make yourself heard.

Buttons and interactive elements

Colour contrast also plays a significant role in identifying buttons and interactive elements on a website. If a button blends into the page's background, users may miss it entirely. This is particularly problematic for people with colour blindness who rely on contrast to differentiate between elements. It’s like having a camouflaged door in a wall—without clear markers, people won’t know it’s there. Using contrasting colours for buttons and hover states can guide users smoothly through your site.

Icons and graphics

Icons and graphics should also meet contrast requirements. They often convey important information, such as navigation instructions or notifications. If their contrast is too low, users might miss out on key details. Imagine a road sign that blends into the landscape—you wouldn’t know when to stop or turn. Similarly, increasing the contrast of icons helps users quickly identify their purpose, making the overall user experience smoother.

Good vs bad colour contrast

High contrast done right

Imagine a website for a local restaurant that uses a white background with dark navy text. The contrast between these colours makes it easy for most users to read the menu, navigate the page, and find information quickly. This combination would likely exceed the WCAG’s recommended ratio, making the site accessible for those with visual impairments.

Low contrast pitfalls

Now, picture a website for a tech startup that uses trendy design elements—light grey text on a pastel pink background. While it might look sleek, this design choice can be a nightmare for users with low vision. The text and background colours are too similar, making the words hard to discern. It’s like trying to read a note written with a pencil on a piece of paper—stylish but impractical.

Tools for checking colour contrast

Automated tools

There are several tools available online to help designers check colour contrast ratios. Popular options include WebAIM's Contrast Checker, which allows you to input foreground and background colours to see if they meet WCAG standards. These tools act like a second pair of eyes, helping you spot issues before they reach users.

Browser extensions

Some browser extensions can simulate different types of visual impairments, allowing you to see your website through the eyes of someone with colour blindness or low vision. This helps designers understand how contrast impacts user experience, much like trying on someone else’s glasses to see how blurry their vision might be. It's an eye-opening (literally!) way to empathise with users’ needs.

Visual builders guides

Visual builder guides, like Webflow, make it easier to create accessible websites by offering tools like the colour picker with contrast ratio checks. This ensures designers meet accessibility standards effortlessly. Webflow’s Vision Preview tool goes a step further, allowing users to simulate how individuals with various vision impairments perceive a website. This helps creators refine their designs for a more inclusive experience, ensuring readability and usability for all users.

Best practices for using colour contrast

Accessible colour palettes

When designing a website, start with a colour palette that considers accessibility from the get-go. This doesn’t mean sacrificing creativity for compliance. You can use contrasting shades within a colour scheme to create visually appealing yet accessible designs. For instance, a navy blue against a pastel background provides a pleasing contrast that remains readable. It’s like choosing complementary colours for an outfit—they may be different, but they work well together.

Semi-transparent overlays

A common issue arises when using background images with text overlays. If the image is too vibrant, the text can become difficult to read. Applying a semi-transparent overlay to the image can solve this, adding contrast without dulling the background. Imagine watching a movie scene through tinted glass—you can still enjoy the view without the glare getting in the way. This technique ensures that the background image remains a part of the design while keeping the text legible.

Brightness and saturation

Small tweaks to brightness and saturation can make a significant difference in contrast. Increasing the brightness of lighter colours or deepening darker shades can bring a design into compliance without drastic changes. It’s similar to adjusting the settings on your TV for a clearer picture—you’re not changing the show, just making it easier to enjoy. By fine-tuning colours, you can maintain your brand’s look while ensuring better accessibility.

High-contrast colours

When in doubt, opt for high-contrast colours. Black and white might seem boring, but they offer the highest level of readability. However, that doesn’t mean you need to abandon creativity. Using colours like deep blues, dark greens, or rich purples against light backgrounds can strike a balance between accessibility and design flair. Think of it like adding a little spice to a classic dish—enough to make it interesting, but not so much that it overpowers the basics.

Think of colour contrast like a traffic light. Red, yellow, and green are chosen for their distinct contrast, making them visible even from a distance. Imagine if traffic lights used two shades of blue instead. Drivers would have a hard time distinguishing between signals, leading to confusion and potential accidents

Avoid relying on colour alone

One common mistake is using colour alone to convey information, like marking required fields with just a red asterisk. For users who can’t perceive red, this is the digital equivalent of speaking a language they don’t understand. Pairing colours with text or symbols (like “required” labels or icons) ensures that all users can understand the message. It’s like adding subtitles to a film in a foreign language—everyone deserves to follow the plot.

The impact of good contrast on user experience

Getting colour contrast right is about more than just ticking a box—it directly impacts user experience. Well-contrasted elements make websites easier to navigate, improving usability for everyone, not just those with vision impairments. It’s like providing a well-lit path through a forest—whether it’s day or night, everyone benefits from the added clarity. Ensuring strong contrast contributes to a more inclusive digital space where users feel welcome and engaged.

Designing with empathy

Colour contrast might seem like a small detail, but it’s a crucial part of inclusive design. By considering the needs of users with visual impairments, you’re creating a website that’s accessible to all. It’s like adding a ramp to a building—most people might not think about it, but it makes a world of difference for those who need it. Prioritising accessibility is not just good practice; it’s a way to show that your website is open to everyone.

Profile picture of lead designer and accessibility expert at akW dezign Northampton
by
Alicia Krawczyk
Published on:
October 11, 2024
Ready to rule the online?

Want to make your website more accessible?

Other aricles