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

Home » Public Forums » archive » 24 bit colors in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
24 bit colors in IDL [message #13280] Tue, 03 November 1998 00:00 Go to previous message
Richard Penrose is currently offline  Richard Penrose
Messages: 4
Registered: November 1998
Junior Member
I am working on a piece of software written in IDL that has always
assumed the color resolution to be 256 colours. I would like to be able
to use the same piece of software on a machine which has a flashy
graphics card and only allows a colour resolution of 24 bits (True
Colour).

At the moment when I change the colour resolution it messes up all of
the software's colours. The piece of code that we use to set up the
colours is as follows:


iaR
= $
[255,1,192,128,255,142,255,213, 0, 0, 0, 0, 0,
0,255,197,248,247]
iaG
= $
[255,1,192,128, 0, 0,255,213,255,176,255,171, 0,
0,192,138,208,167]
iaB
= $
[255,1,192,128, 0, 0, 0, 0, 0, 0,255,171,255,185, 0,
0,198,195]

tvlct, iaR, iaG, iaB

st_color = { $
i_white : 0 ,
$
i_black : 1 ,
$
i_light_grey : 2,
$
i_dark_grey : 3,
$
i_light_red : 4,
$
i_red : 4,
$
i_dark_red : 5,
$
i_light_yellow : 6,
$
i_yellow : 6,
$
i_dark_yellow : 7,
$
i_light_green : 8,
$
i_dark_green : 9,
$
i_light_cyan : 10,
$
i_dark_cyan : 11,
$
i_light_blue : 12,
$
i_dark_blue : 13,
$
i_light_orange : 14,
$
i_orange : 14,
$
i_dark_orange : 15,
$
i_light_pink : 16,
$
i_dark_pink : 17
$
}

We then use the st_color structure to access the iaR, iaG, iaB arrays
and get the desired color, e.g. [1,1,1] should give black and
[255,255,255] should give white.

Now it seemed obvious to me that to upgrade to 24 bit colours all I
needed to do was to
multiply each element of the iaR, iaG, iaB arrays by 65536 and subtract
1. Disappointingly this does not seem to work!

Can anyone help.

Cheers Richard
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Status Bar Help
Next Topic: Is the new IDL5.2 for Linux ELF-based or a.out-based?

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

Current Time: Fri Oct 10 10:11:28 PDT 2025

Total time taken to generate the page: 0.87808 seconds