Skip to content

Data Colors (dataviz)

For implementation, see Tokens & CSS.

On this page:

Semantic data colors for dataviz

For data colors, there are different semantic colors that should be used intentionally: Primary, Secondary, Category and Evaluation colors.

In dataviz we use visual elements to encode data (sometimes referred to as ‘data marks’).

Primary – when you only need one color

Example of blue bars and a blue line in light mode and dark mode

If you only need one color (or hue) in a chart, use the Primary color. The primary color is blue, but the shade varies across light mode, dark mode and the it is applied to.

By using the primary color across multiple graphs, our pages get a consistent and professional look and feel.

Primary: Blue

NameLight/Dark modeDescription
Background/Primaryblue boxesBars and areas
Background/Primary-Subtleblue boxesSubtle color for bars and areas
Line/Primaryblue linesLines and points
Border/Primaryblue linesBorder around -Subtle
Text/Primaryblue textText
Icon/Primaryblue iconsIcons

Secondary – for secondary information

Example of blue and gray bars and a gray line in light mode and dark mode

When you want to indicate that a data category is secondary, you may use the secondary color. The primary color is gray.

The secondary color can be useful if you want to compare some important data with reference data, for example this year against last year, or your own performance against others’.

In general the Secondary color should be used together with the Primary color, and it doesn’t make much sense to use the Secondary color alone.

Secondary: Gray

NameLight/Dark modeDescription
Background/Secondarygray boxesBars and areas
Background/Secondary-Subtlegray boxesSubtle color for bars and areas
Line/Secondarygray linesLines and points
Border/Secondarygray linesBorder around -Subtle
Text/Secondarygray textText
Icon/Secondarygray iconsIcons

Category – to differentiate between categories

8 stacked bars in light mode and dark mode with different colors: indigo, yellow, pink, green, red, teal, blue, gray

There are 8 category colors to indicate different categories of data: indigo, yellow, pink, green, orange, teal, blue and gray.

The category colors are suited for “nominal data” – which means data that represents different categories without any inherent order. In other words: things that are of equal importance. Examples: different brands, verticals, countries or product types.

Category1: Indigo

NameLight/Dark modeDescription
Background/Category1indigo boxesBars and areas
Background/Category1-Subtleindigo boxesSubtle color for bars and areas
Line/Category1indigo linesLines and points
Border/Category1indigo linesBorder around -Subtle
Text/Category1indigo textText
Icon/Category1indigo iconsIcons

Category2: Yellow

NameLight/Dark modeDescription
Background/Category2yellow boxesBars and areas
Background/Category2-Subtleyellow boxesSubtle color for bars and areas
Line/Category2yellow linesLines and points
Border/Category2yellow linesBorder around -Subtle
Text/Category2yellow textText
Icon/Category2yellow iconsIcons

Category3: Pink

NameLight/Dark modeDescription
Background/Category3pink boxesBars and areas
Background/Category3-Subtlepink boxesSubtle color for bars and areas
Line/Category3pink linesLines and points
Border/Category3pink linesBorder around -Subtle
Text/Category3pink textText
Icon/Category3pink iconsIcons

Category4: Green

NameLight/Dark modeDescription
Background/Category4green boxesBars and areas
Background/Category4-Subtlegreen boxesSubtle color for bars and areas
Line/Category4green linesLines and points
Border/Category4green linesBorder around -Subtle
Text/Category4green textText
Icon/Category4green iconsIcons

Category5: Orange

NameLight/Dark modeDescription
Background/Category5orange boxesBars and areas
Background/Category5-Subtleorange boxesSubtle color for bars and areas
Line/Category5orange linesLines and points
Border/Category5orange linesBorder around -Subtle
Text/Category5orange textText
Icon/Category5orange iconsIcons

Category6: Teal

NameLight/Dark modeDescription
Background/Category6teal boxesBars and areas
Background/Category6-Subtleteal boxesSubtle color for bars and areas
Line/Category6teal linesLines and points
Border/Category6teal linesBorder around -Subtle
Text/Category6teal textText
Icon/Category6teal iconsIcons

Category7: Blue

NameLight/Dark modeDescription
Background/Category7blue boxesBars and areas
Background/Category7-Subtleblue boxesSubtle color for bars and areas
Line/Category7blue linesLines and points
Border/Category7blue linesBorder around -Subtle
Text/Category7blue textText
Icon/Category7blue iconsIcons

Category8: Gray

NameLight/Dark modeDescription
Background/Category8gray boxesBars and areas
Background/Category8-Subtlegray boxesSubtle color for bars and areas
Line/Category8gray linesLines and points
Border/Category8gray linesBorder around -Subtle
Text/Category8gray textText
Icon/Category8gray iconsIcons

Evaluation - to indicate something positive, neutral or negative

Icon and text with similar colors: blue arrow going up, gray arrow across, red arrow going down. Icons with color next to bars with same color: green smile, yellow flat mouth, red unhappy face

Use evaluation colors when you need the colors to indicate if the data is positive or negative for the intended user in a specific use case. The semantic options are:

  • Positive (green) to indicate positive data, such as increase in sales or engagement, or the effect of using a product or service. You can also use the Primary color (blue) to indicate something positive
  • Warning (yellow) to indicate data that need attention or may soon encounter problems
  • Negative (red) to indicate negative data, such as decrease in sales or engagement
  • Neutral (grey) to indicate baseline or standard data next to positive or negative data.
How can red and green work for people with color deficiencies?

Green and red are well established colors for indicating positive or negative values. However, this color combination is particularly challenging for people with color deficiencies. We have tried to find shades of red and green that can work for many with color deficiencies, but the colors will not be possible to differentiate for everyone.

What you can do to make the colors work for everyone:

  • Make sure to use something in addition to color to indicate the value, for example an icon or text. Think that the visualization should make sense even if it was printed in black and white. See illustration above for an example.
  • Use the Primary color (blue) instead of Positive (green). Blue and red is a safer combination than green and red
  • Use areas and bars rather than lines. It is easier for people to differentiate colors for large areas than for small elements
  • Combine a background color with a background-subtle color, for example Background/Positive with Background/Negative-Subtle

What is positive or negative for the user depends on the context. Sometimes it is positive that a number goes up, sometimes it is positive that it goes down. Sometimes it is positive that a value is low or high, other times it is more important if the trend is going up or down.

Positive: Green

NameLight/Dark modeDescription
Background/Positivegreen boxesBars and areas
Background/Positive-Subtlegreen boxesSubtle color for bars and areas
Line/Positivegreen linesLines and points
Border/Positivegreen linesBorder around -Subtle
Text/Positivegreen textText
Icon/Positivegreen iconsIcons

Warning: Yellow

NameLight/Dark modeDescription
Background/Warningyellow boxesBars and areas
Background/Warning-Subtleyellow boxesSubtle color for bars and areas
Line/Warningyellow linesLines and points
Border/Warningyellow linesBorder around -Subtle
Text/Warningyellow textText
Icon/Warningyellow iconsIcons

Negative: Red

NameLight/Dark modeDescription
Background/Negativered boxesBars and areas
Background/Negative-Subtlered boxesSubtle color for bars and areas
Line/Negativered linesLines and points
Border/Negativered linesBorder around -Subtle
Text/Negativered textText
Icon/Negativered iconsIcons

Neutral: Gray

NameLight/Dark modeDescription
Background/Neutralgray boxesBars and areas
Background/Neutral-Subtlegray boxesSubtle color for bars and areas
Line/Neutralgray linesLines and points
Border/Neutralgray linesBorder around -Subtle
Text/Neutralgray textText
Icon/Neutralgray iconsIcons

Color guidelines

Don't use color alone to differentiate between categories

White checkmark on a green background Do

A blue circle next to 7 gray circles, all directly labelled
Use other methods than color alone to distinguish between categories. Example: add text labels, group into fewer categories, use distinctive patterns or shapes, or use small multiples.

White cross on a red background Don't

8 circles in different colors, with legend below
Don’t use too many colors at once. Extensive use of color can make a graph and a page appear busy and chaotic, and be impossible to read for people with color deficiencies.

See visual success criteria nr. 1: Don’t rely on color alone to explain data.

Consider the order of categorical colors

The colors don’t have to be applied in any particular order, and all combinations of categorical colors should work reasonably well. However, randomly choosing colors can have some negative consequences.

If you choose to not follow the order of color in the library, consider this:

  • Avoid using orange unless there are already many other categorical colors in use, as orange alone can easily be perceived as negative. In particular, avoid orange together with green or teal. Use the evaluation colors if the intension is to indicate something good or bad
  • If possible, only use orange if the graph already includes pink. This reduces the risk of interpreting orange as negative
  • Only use blue and grey from the category palette when many other colors are in use. Otherwise the information can wrongly be interpreted as primary and secondary.

If you use the order of the colors in the library, you don’t have to think about these issues.

Be careful using category colors for specific data types

It is possible to use Category colors in a way that makes it easier for users to recognise specific types of data or differentiate between graphs. For example, in Mobility you could always use specific colors to represent cars running on petrol, diesel or electricity. This is especially useful if there are several graphs in a view that share the same data types. In addition, using different colors for different data types and graphs can make it easier for people to recognise and differentiate between the graphs.

However, be aware of some potential issues with this approach:

  • You will run out of colors!
  • If there are many graphs with many different colors in a view, the result might become chaotic and overwhelming, thereby appear less professional and trustful
  • There will be inconsistencies across verticals (and even between services within a vertical) as it is impossible to have enough colors for all data options.