SquishPixel Blog · Accessibility · Web design and UX · Front-end

Building accessible colour systems for data-heavy dashboards

DEV Community has published a guide to building an accessible colour system for dashboards that show a lot of data. Dashboards often use colour to carry meaning, such as green for up, red for down and blue for neutral. The article says 8 percent of men have some form of colour vision deficiency, and a pure red-green scheme is invisible to them.

The first step it recommends is to start with luminance, which is how light or dark a colour appears. If two colours that mean different things have the same luminance, they look identical in greyscale. The suggested test is to convert the palette to greyscale and check that every meaningful pair of colours is still clearly different.

The second step is to double-encode. This means never relying on colour alone. Add another channel, such as an arrow icon for direction, a pattern fill for chart segments, or a text label. According to the article, the icon and the number should be able to carry the message on their own, because some viewers will never see the colour difference.

The article also covers contrast ratios. It cites WCAG 2.1 AA, which requires 4.5:1 for normal text and 3:1 for large text. For coloured badges on coloured backgrounds, it says to test both the text against the badge and the badge against the surface behind it.

Finally, it addresses dark mode. Colours that pass contrast checks in light mode often fail in dark mode, so the article advises defining separate colour values for each theme instead of simply inverting them. Its example is that hsl(142, 70%, 40%) on white becomes hsl(142, 60%, 65%) on dark grey.

Why it matters

If your site or app shows statuses, trends or alerts in colour, some of your visitors may not be able to read them. A red and green indicator with no other cue can leave those users guessing, which makes the data less useful and the page harder to trust.

The checks in the article are cheap to run. A greyscale preview, a second signal such as an icon or label, a contrast test and a separate dark mode palette can all be done during normal design and review work, without a redesign.

Source: DEV Community. This brief summarises their reporting; read the original for the full detail.