The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Paul Tol’s Color Schemes

N. Frerebeau

2024-08-26

library(khroma)

1. Introduction

Tol (2021) offers carefully chosen schemes, ready for each type of data, with colors that are:

All the scales presented in Paul Tol’s technical note (issue 3.2, 2021-08-18) are implemented here, for use with base R graphics, ggplot2 or ggraph.

2. Qualitative data

According to Paul Tol’s technical note, the bright, contrast, vibrant and muted color schemes are color-blind safe.

The light color scheme is reasonably distinct for both normal or color-blind vision and is intended to fill labelled cells.

The pale and dark schemes are not very distinct in either normal or color-blind vision and should be used as a text background or to highlight a cell in a table.

The qualitative color schemes must be used as given (no interpolation): colors are picked up to the maximum number of supported values. Refer to the original document for details about the recommended uses (see references).

Scheme Max. colors
bright 7
high contrast 3
vibrant 7
muted 9
medium contrast 3
pale 6
dark 6
light 9

2.1 bright

bright <- color("bright")
plot_scheme(bright(7), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_bright

plot of chunk tol_quali_bright

2.2 high contrast

highcontrast <- color("high contrast")
plot_scheme(highcontrast(3), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_highcontrast

plot of chunk tol_quali_highcontrast

2.3 vibrant

vibrant <- color("vibrant")
plot_scheme(vibrant(7), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_vibrant

plot of chunk tol_quali_vibrant

2.4 muted

muted <- color("muted")
plot_scheme(muted(9), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_muted

plot of chunk tol_quali_muted

2.5 medium contrast

mediumcontrast <- color("medium contrast")
plot_scheme(mediumcontrast(6), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_mediumcontrast

plot of chunk tol_quali_mediumcontrast

2.6 pale and dark

pale <- color("pale")
plot_scheme(pale(6), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_pale_dark

plot of chunk tol_quali_pale_dark


dark <- color("dark")
plot_scheme(dark(6), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_pale_dark

plot of chunk tol_quali_pale_dark

2.7 light

light <- color("light")
plot_scheme(light(9), colours = TRUE, names = TRUE, size = 0.9)
plot of chunk tol_quali_light

plot of chunk tol_quali_light

3. Diverging data

If more colors than defined are needed from a given scheme, the color coordinates are linearly interpolated to provide a continuous version of the scheme.

Scheme Num. of colors Bad data
sunset 11 #FFFFFF
nightfall 17 #FFFFFF
BuRd 9 #FFEE99
PRGn 9 #FFEE99

3.1 sunset

sunset <- color("sunset")
plot_scheme(sunset(11), colours = TRUE, size = 0.9)
plot of chunk tol_div_sunset

plot of chunk tol_div_sunset

3.2 nightfall

nightfall <- color("nightfall")
plot_scheme(nightfall(17), colours = TRUE, size = 0.9)
plot of chunk tol_div_nightfall

plot of chunk tol_div_nightfall

3.3 BuRd

BuRd <- color("BuRd")
plot_scheme(BuRd(9), colours = TRUE, size = 0.9)
plot of chunk tol_div_BuRd

plot of chunk tol_div_BuRd

3.4 PRGn

PRGn <- color("PRGn")
plot_scheme(PRGn(9), colours = TRUE, size = 0.9)
plot of chunk tol_div_PRGn

plot of chunk tol_div_PRGn

4. Sequential data

If more colors than defined are needed from a given scheme, the color coordinates are linearly interpolated to provide a continuous version of the scheme, with the exception of the discrete rainbow scheme (see below).

Scheme Num. of colors Bad data
YlOrBr 9 #888888
iridescent 23 #999999
incandescent 11 #888888
discrete rainbow 23 #777777
smooth rainbow 34 #666666

4.1 YlOrBr

YlOrBr <- color("YlOrBr")
plot_scheme(YlOrBr(9), colours = TRUE, size = 0.9)
plot of chunk tol_seq_YlOrBr

plot of chunk tol_seq_YlOrBr

4.2 iridescent

iridescent <- color("iridescent")
plot_scheme(iridescent(23), colours = TRUE, size = 0.5)
plot of chunk tol_seq_iridescent

plot of chunk tol_seq_iridescent

4.3 incandescent

incandescent <- color("incandescent")
plot_scheme(incandescent(11), colours = TRUE, size = 0.5)
plot of chunk tol_seq_incandescent

plot of chunk tol_seq_incandescent

4.4 rainbow

As a general rule, ordered data should not be represented using a rainbow scheme. There are three main arguments against such use (Tol 2021):

If such use cannot be avoided, Paul Tol’s technical note provides two color schemes that are reasonably clear in color-blind vision. To remain color-blind safe, these two schemes must comply with the following conditions:

discrete rainbow : This scheme must not be interpolated.

smooth rainbow : This scheme does not have to be used over the full range. Tol (2021) suggests starting at purple.

discrete_rainbow <- color("discrete rainbow")
plot_scheme(discrete_rainbow(14), colours = TRUE, size = 0.7)
plot of chunk tol_seq_rainbow

plot of chunk tol_seq_rainbow

When using the smooth rainbow scheme:

smooth_rainbow <- color("smooth rainbow")

## Start at purple instead of off-white
plot(smooth_rainbow(256, range = c(0.25, 1)))
plot of chunk tol_seq_adjust

plot of chunk tol_seq_adjust

## End at red instead of brown
plot(smooth_rainbow(256, range = c(0, 0.9)))
plot of chunk tol_seq_adjust

plot of chunk tol_seq_adjust

5. Diagnostic maps

5.1 Qualitative color schemes

Diagnostic maps for the bright, vibrant, muted and light (from top to bottom) qualitative color schemes.Diagnostic maps for the bright, vibrant, muted and light (from top to bottom) qualitative color schemes.Diagnostic maps for the bright, vibrant, muted and light (from top to bottom) qualitative color schemes.Diagnostic maps for the bright, vibrant, muted and light (from top to bottom) qualitative color schemes.

Diagnostic maps for the bright, vibrant, muted and light (from top to bottom) qualitative color schemes.

5.2 Diverging schemes

Diagnostic maps for the sunset, BuRd and PRGn (from top to bottom) diverging color schemes.Diagnostic maps for the sunset, BuRd and PRGn (from top to bottom) diverging color schemes.Diagnostic maps for the sunset, BuRd and PRGn (from top to bottom) diverging color schemes.Diagnostic maps for the sunset, BuRd and PRGn (from top to bottom) diverging color schemes.

Diagnostic maps for the sunset, BuRd and PRGn (from top to bottom) diverging color schemes.

Diagnostic maps for the sunset, BuRd and PRGn diverging color schemes.Diagnostic maps for the sunset, BuRd and PRGn diverging color schemes.Diagnostic maps for the sunset, BuRd and PRGn diverging color schemes.Diagnostic maps for the sunset, BuRd and PRGn diverging color schemes.

Diagnostic maps for the sunset, BuRd and PRGn diverging color schemes.

5.3 Sequential schemes

Diagnostic maps for the YlOrBr, iridescent, discrete rainbow and smooth rainbow (from top to bottom) sequential color schemes.Diagnostic maps for the YlOrBr, iridescent, discrete rainbow and smooth rainbow (from top to bottom) sequential color schemes.Diagnostic maps for the YlOrBr, iridescent, discrete rainbow and smooth rainbow (from top to bottom) sequential color schemes.Diagnostic maps for the YlOrBr, iridescent, discrete rainbow and smooth rainbow (from top to bottom) sequential color schemes.Diagnostic maps for the YlOrBr, iridescent, discrete rainbow and smooth rainbow (from top to bottom) sequential color schemes.

Diagnostic maps for the YlOrBr, iridescent, discrete rainbow and smooth rainbow (from top to bottom) sequential color schemes.

Diagnostic maps for the YlOrBr, iridescent and smooth rainbow sequential color schemes.Diagnostic maps for the YlOrBr, iridescent and smooth rainbow sequential color schemes.Diagnostic maps for the YlOrBr, iridescent and smooth rainbow sequential color schemes.Diagnostic maps for the YlOrBr, iridescent and smooth rainbow sequential color schemes.

Diagnostic maps for the YlOrBr, iridescent and smooth rainbow sequential color schemes.

6. References

Tol, P. 2021. “Colour Schemes.” Technical note SRON/EPS/TN/09-002 3.2. SRON. URL: https://personal.sron.nl/~pault/data/colourschemes.pdf.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.