Colour foundations
Carefully considered colours for data visualisation
Principles
Balancing the requirements of accessibility, personal perception, system preferences, cultural association and branding is difficult to get right.
Follow these principles
Colours should be easily differentiated by as many people, in as many environments as possible.
Colours should have appropriate levels of contrast with the background. The smaller the element, the higher the contrast required.
Use a single colour that highlights your key data, and grey for secondary contextual data.
Only use a second or third categorical colour if direct comparison of data is required.
Don’t use more than 2 or 3 categorical colours. Consider labelling, line styling or small multiples instead.
Keep colour meaning consistent across all charts that are likely to be read in the same context.
Use colour to connect information across different charts and editorial.
Some colours have overriding cultural, political or contextual meaning. Try and reserve those if you’ll need them later in your presentation. E.g. Red = Bad, Failing or Hot, Green = Good, improving or Environment, Blue = cold, etc...
Practice
Categorical colours
Categorical (or qualitative) colours are used to identify and differentiate data that has no particular order or value. For example, a set of London boroughs, industry types or groups of people.
Categorical colours should be as visually differentiable as possible, and maintain a high level of contrast with their background.
Our categorical colours
We developed our categorical colour palettes by carefully balancing the requirements of GLA brand recognition, colour differentiation and contrast.
Switching between our light and dark categorical palettes is easy, because they have a consistent colour naming scheme (categorical-blue, red, green, etc).
Categorical palette
These categorical colours pass differentiation tests for all but small lines, but don't use them all in a single chart.
Considering contrast ratios in your colour choices
When selecting colours directly from the categorical palette, choose as few as possible, and prioritise colours with higher contrast ratios (4.5:1+).
Colour differentiation is harder when elements are smaller, as there is physically less colour to see.
Using high contrast and easily differentiable colours are particularly important when producing line charts. For bar charts and other larger graphical elements, you can lower your contrast a bit.
As with large text, for graphical objects such as charts and graphs a contrast ratio of 3:1 should be sufficient
WCAG Guidelines
Line chart of London variable values
Semantic data colours
We've created semantic tokens to simplify and standardise the use of our colours.
Semantic colour tokens
Prioritisation
We recommend you consistently use color-data-primary, secondary and tertiary in your charts, unless you have a specific reason for choosing a different set.
These colours are easily differentiated, and have an equivalent set in dark mode.
Line chart of London variable values
For charts where you want to show "other" or "context" data, use color-data-primary and color-data-context.
Line chart of London variable values
Demographics
When representing sex in your demography data, use color-data-male and color-data-female. The Purple and Green is a tribute to the Suffragette flag (and a great idea we borrowed from the Telegraph style guide).
Opinion
If you are visualising diverging data (like opinion research) or want to explicitly show if something is good or bad, then use color-data-positive, and color-data-negative.
We've chosen blue and red to represent good and bad, to avoid the common red/green colour differentiation issue.
It's also useful to have a couple of neutral grey's for "neither" and "don't know". Here you can use color-data-neutral-0 and color-data-neutral-1.
Missing data
Sometimes you need to show missing (or filtered out) data. Here you can use color-data-empty.
Chart styling
To ensure consistency and correct contrast across all charts, use the following tokens to define your chart's surface, axis, grid and labels.