JuliaAttic / Color.jl

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

Black in Colormaps #71

Closed yakir12 closed 7 years ago

yakir12 commented 9 years ago

Is it possible to add an option for instead of going from white to blue in colormap("Blues"), go from black to blue (while retaining all the awesomeness of perceptually uniform, colorblind friendly, and suitable for black-and-white printing)? The logic is that in some applications black represents "nothing" or "no data" as opposed to low intensity in what ever the image is showing.
This would be really useful in diverging_palette(h1, h2) as well (so going from h1 to black to h2): low and high pixel values are actually both "high" but from opposing polarities (hence the different hues) while mid-range pixel values are low on both polarities and therefore should be black. Thanks!

natj commented 9 years ago

Currently the algorithm is designed to go from dark (i.e. the chosen color) to white so this would need a redesign of the existing function. One thing worth a try is, however, to try and play with the keywords

wcolor - starting color i.e. the middle color (warmness, usually defined to be yellow)
dcolor1 - ending color of the left side (depth)
dcolor2 - ending color of the right side (depth)

that let you set the first, middle and ending color of the colormap in diverging_palette function call.