comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: staying away from color indices 0, and 255?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: staying away from color indices 0, and 255? [message #47269] Wed, 01 February 2006 12:18 Go to previous message
Paul Van Delst[1] is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: staying away from color indices 0, and 255?
Next Topic: IDLWave upgrading?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:43:45 PDT 2025

Total time taken to generate the page: 1.44079 seconds