[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Device Independent Colors



Hi Folks,

As part of a continuing effort on my part to write programs
that behave in a device-independent way, I have upgraded my
GetColor program. In particular, I am interested in writing
programs in which I can specify colors without regard to 
whether I am on an 8-bit or 24-bit display, or without regard
to whether color decomposition is on or off.

To that end, I have added new LOAD and START keywords to
GetColor that will automatically load the 16 McIDAS colors
available in GetColor in a manner in which they are device
and color decomposition independent. 

For example, the following code will behave correctly
on 8-bit and 24-bit displays, no matter what the state of
color decomposition. (Please note that you can obtain the
color decomposition state only in IDL 5.2 and higher.)

   colors = GetColor(/Load, Start=230)
   Plot, data, Color=colors.yellow, Background=colors.gray
   OPlot, data, PSym=4, Color=colors.green

You can find the GetColor program here:

   http://www.dfanning.com/programs/getcolor.pro

Cheers,

David

P.S. As always, I'm looking for volunteer bug finders. :-)

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155