JuliaAttic / Color.jl

Basic color manipulation utilities.
Other
47 stars 21 forks source link

Request: add support for cubehelix (and variants) #78

Open JobLeonard opened 9 years ago

JobLeonard commented 9 years ago

Issue opened per suggestion in the discussion on better defaults for colour vision deficiencies on Google Groups.

Many colour schemes [...] do not have an underlying increase in the perception of the brightness of the colours used (e.g. burning out to red for the high data values, but using yellow/green for intermediate data values, which are perceived as being brighter than the red).

[Cubehelix] is intended to be perceived as increasing in intensity. This goes from black to white, deviating away from a pure greyscale (i.e. the diagonal from black to white in a colour cube) using a tapered helix in the colour cube, while ensuring a continuous increase in perceived intensity. The deviation from the diagonal takes into account that red, green and blue are not perceived equally in terms of intensity. This colour scheme prints as a monotonically increasing greyscale on black and white postscript devices.

https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/

One of its benefits is that it is much easier to read for people with colour vision deficiency:

http://www.ifweassume.com/2013/05/cubehelix-or-how-i-learned-to-love.html

Furthermore it is highly tweakable for specific needs. For example, the default uses RGB colour space, but the algorithm should also work for other colour spaces, with perhaps even better results.

timholy commented 9 years ago

@JobLeonard, a pull request is always the best way to make sure that things you want get added.

Have you also checked out the existing capabilities? The combination of distinguishable_colors and the colorblindness mapping functions may basically achieve what you want, and in a sense are more first-principles than any specific colormap.