Re: staying away from color indices 0, and 255? [message #47269] |
Wed, 01 February 2006 12:18  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
savoie@nsidc.org wrote:
>
> Hey all,
>
> I'm generating some images for publication, and I've *always* been able to
> escape postscript, until now. So I found lots of information about how to do
> device independent graphics, but as I was reading the notes on David's site
> (in the TOMS tutorial
> http://www.dfanning.com/graphics_tips/toms_tutorial.html) and found this:
>
>
> "Note I have added 1 to the result, so that the TOMS data is now scaled from
> 1 to 7, instead of from 0 to 6. I have learned from hard experience that if
> you are working with colors in a PostScript file, you want to stay well away
> from color indices 0 and 255. Use any other color indices, but not either one
> of those! (This is not bad advice, in general, as it turns out.)"
>
> I understand that the 0th index gets changed often. But why is it a good
> reason to stay away from index 255?
>
> I ask, because I've always reserved the top 16 colors for myself and done
> scaling and loadct, etc, into the remaining locations, and before I rewrite
> that code, I thought I'd see how dire it's going to be.
>
> So can anyone enlighten me on this?
It buggerises up the defaults for !P.COLOR and !P.BACKGROUND for onscreen work. For PS
output the effects are a bit more esoteric, but I assume similar behaviour for my work.
Try doing
IDL> tvlct,r,g,b,/get
IDL> plot,indgen(10)
IDL> idx=0
IDL> r[idx]=50 & g[idx]=100 & b[idx]=150
IDL> tvlct,r,g,b
IDL> plot,indgen(10)
IDL> idx=255
IDL> r[idx]=150 & g[idx]=100 & b[idx]=50
IDL> tvlct,r,g,b
IDL> plot,indgen(10)
to get an idea of what can happen on screen. Test on PS output (when you've figured it
out, let us know.... I can never remember how it works).
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
|
|
|