Login  Register

What color from the Color Picker?

Posted by Gabriel Landini on Oct 17, 2009; 2:59pm
URL: http://imagej.273.s1.nabble.com/What-color-from-the-Color-Picker-tp3690712.html

Hi,
In the color picker I have 2 arbitrary colors set as fore/background.
If one uses those with an 8 bit image to draw some pixels using the pencil
tool, they appear as a grey tone.
I've looked in the IJ source, and found that the FG color can be obtained
from:

Toolbar.getForegroundColor();

My question is, what color does it correspond to, so one can use it in for
example:

 ip.putPixel(x,y, color)

I guess that this color is mapped to some gray value for 1-channel image
types. But how is that done?

Thanks,

Gabriel