Skip to content

Instantly share code, notes, and snippets.

@macoj
Last active November 23, 2016 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macoj/fa015d4c3ba482c866c9e5f8f9187cde to your computer and use it in GitHub Desktop.
Save macoj/fa015d4c3ba482c866c9e5f8f9187cde to your computer and use it in GitHub Desktop.
colorblind palette

Colorblind palette!

Colors from From: Wong, Bang. "Points of view: Color blindness." Nature methods 8.6 (2011): 441-441. in RGB:

color_names = ["Black", "Orange", "Sky blue", "Bluish green", "Yellow", "Blue", "Vermillion", "Reddish purple"]
colors_colorblind_safe = [(0, 0, 0), (230, 159, 0), (86, 180, 233), (0, 158, 115), (240, 228, 66), (0, 114, 178), (213, 94, 0), (204, 121, 167)]
colors_colorblind_safe = ['#%02x%02x%02x' % (c[0], c[1], c[2]) for c in colors_colorblind_safe]
colors = dict(zip(color_names, colors_colorblind_safe))
three_colors = colors['Blue'], colors['Vermillion'], colors['Bluish green']
three_colors_grayscale = colors['Blue'], colors['Orange'], colors['Bluish green']

Remember that some colors are not grayscale-safe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment