Skip to content
A Collection of Colour-blind-friendly Colour Tables
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images Add files via upload Aug 9, 2017
CODE_OF_CONDUCT.md
README.md
colorblind.pro Update colorblind.pro Aug 9, 2017
colorblind2.pro Update colorblind2.pro Aug 9, 2017
npr_colors.pro Add files via upload Aug 9, 2017

README.md

ColourBlind

A collection of colour-blind-friendly colour tables for sequential, diverging, and qualitative data, provided for use with the Interactive Data Language (IDL). RGB values can additionally be found within the code descriptions below.

This repository was inspired after many people approached me to judge the colour blind friendliness of their plots (and in some part, by this tweet). The final aim of this repository is to collate colours tables from many sources (see "code descriptions and their origins") and provide them in an easy-to-use format. For those looking for nice examples, this article on picking a colour scale for scientific graphics is a great start, and a number of the colorbrewer tables can be found within IDL. Additionally this GitHub repository allows the user to import matplotlib (http://bids.github.io/colormap/) colour tables into IDL.

If you wish to acknowledge use of this repository, I recommend text such as the following:

  • Some/all of the figures within this paper were produced using IDL colour-blind-friendly colour tables \citep[see][]{pjwright}.

  • This research made use of IDL colour-blind-friendly colour tables \citep[see][]{pjwright}.

where the BibTeX entry is as follows (In accordance with advice outlined by the AAS):

@misc{pjwright,
author = {Paul J. Wright},
title = {{ColourBlind: A Collection of IDL Colour-blind-friendly Colour Tables}},
month = Aug,
year = 2017,
doi = {10.5281/zenodo.840393},
publisher = {Zenodo},
url = {https://github.com/PaulJWright/ColourBlind}
}

with the DOI that is not specific to a particular version:

DOI

Publications using ColourBlind:

  1. Marsh, A. J., Smith, D. M., Glesener, L, et al. 2017, ApJ, 849, 131
  2. Wright, P. J., Hannah, I. G., Grefenstette, B. W., et al. 2017, ApJ, 844, 132 [Open Access]

Colour Blindness

Colour blindness is really a misnomer. Those who are colour blind are generally colour vision deficient, which is the inability to distinguish certain colours rather than not being able to see them at all.

Color blindness

One method for detecting someone's ability to perceive colour, is the Ishihara test:

Ishihara colour perception test

Two example Ishihara colour test plates (Source: Wikipedia)

Ishihara Test Plate Ishihara Test Plate

(Left) Demonstration plate designed to be visible by all persons, whether normal or colour vision deficient. (Right) The number "74" should be clearly visible to viewers with normal colour vision. Viewers with dichromacy or anomalous trichromacy may read it as "21", and viewers with monochromacy may see nothing.

A Comment on loadct,4

[9th August 2017]

I am currently investigating a replacement for loadct,4 (a notoriously bad colour table for those with colour blindness) where the data is diverging (the data straddle 0, or show a departure from a reference value).

loadct, 4 loadct, 4_new

(Left) loadct,4. (Right) a work in progress that aims to replace loadct,4 in situations where data is diverging:

Hex colours

Code descriptions and their origins:

colorblind.pro:

A set of 7 (+ black and white) colour blind friendly colours based on the notes of Paul Tol (https://personal.sron.nl/~pault/):

"For 5 or more colours, I use them in clockwise order from bottom left (https://personal.sron.nl/~pault/images/betterdistinct.png): blue, cyan, green, yellow, red, pink, grey (and black). For 4 or fewer colours, I switch cyan and red: blue, red, green, yellow. But I deviate when plot lines have a logical colour association, e.g. cloud fraction above oceans blue and above desert yellow."

.compile colorblind.pro
colorblind, n_colors=7, /ploteps
; the code loads in a 7 colour colour table and outputs an 
; EPS indicating the color indexes for the range of n_colors (SolarSoftWare required)
xpalette ;xpalette will display the colour table 
; plot as normal, i.e.:
plot,x,y,color=0 ;color = 0 through 8

where the RGB values are:

R = [68,102,34,204,238,170,187]    
G = [119,204,136,187,102,51,187]   
B = [170,238,51,68,119,119,187]   

colorblind.pro xpalette

colorblind2.pro:

A set of 7 (+ black and white) colour blind friendly colours. These colours are more vibrant than colorblind.pro. Inspired in some part by Wong, B. Nat. Methods 8, 441 (2011).

.compile colorblind2.pro
colorblind2, n_colors=7, /ploteps
; the code loads in a 7 colour colour table and outputs an 
; EPS indicating the color indexes for the range of n_colors (SolarSoftWare required)
xpalette ;xpalette will display the colour table 
; plot as normal, i.e.:
plot,x,y,color=0 ;color = 0 through 8

where the RGB values are:

R = [0,86,0,240,230,213,187]   
G = [114,180,158,228,159,94,187]   
B = [178,233,115,66,0,0,187]   

colorblind2.pro xpalette

npr_colors.pro:

A set of 6 (+ black and white) colour blind friendly colours based on those used by NPR (Credit: Katie Park, Alyson Hurt, Tyler Fisher and Lisa Charlotte Rost/NPR) .

.compile npr_colors.pro
npr_colors
; the code loads in all colours
xpalette ;xpalette will display the colour table 
; plot as normal, i.e.:
plot,x,y,color=0 ;color = 0 through 8

where the RGB values are:

R = [224,240,231,82,0,237]  
G = [70,159,223,192,98,237] 
B = [6,82,190,173,100,237]  

NPR Colours

Further Reading:

Useful Links:

  • Color Oracle is a free colour blindness simulator for Linux/Mac/Windows. In their own words: "it takes the guesswork out of designing for colour blindness by showing you in real time what people with common colour vision impairments will see."
  • coolors.co is a free colour scheme generator.
  • Gregor Aisch’s chroma tool is useful for optimizing your diverging colour palettes. It can help you take two or more colors and generate a full scale of in-between values.
  • ColorBrewer has a range of palettes that are colorblind safe.
  • Multi-hued Color Scales A blog post on multi-hued colour scales.
  • COLOURLovers Pre-made colour palettes, and trends.
You can’t perform that action at this time.