Re: Muting the colors of a color table

Hi Don,

For a given color pallete, what's the best way to "mute"
or "tone down" the colors?

If you mean "make dimmer" then you could simply multiply each color value by 0.5.

If you mean "decrease contrast" then there are a couple of algorithms. One easy way to do it in VisAD would be to expand the range of the ScalarMap, thus narrowing the perceived color variation. Another way (which I use in VisBio) is to alter the original color values based on brightness and contrast values, which effectively control the offset and slope of the color line.

Assuming your color map is to RGB or RGBA, these manipulations would happen to the color table. If you have maps to Red, Green and Blue, though, then you'd need to alter the data itself and setData again (unless you use the setRange approach on the ScalarMaps).

If you are interested in seeing VisBio's implementation in action:
1) Launch the program
2) Choose File -> Sample datasets -> sdub
3) Click Ok to the "Would you like to visualize now" question
4) Click Ok to the display name dialog
5) Select "sdub" from the Data list on the right
6) Click the "Colors" button
7) Try dragging the brightness and contrast sliders and watch how it affects the color table

The implementation of these color table computations can be found in loci/visbio/util/, lines 294-373, with the "slope" and "center" computations being most relevant.