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

Home » Public Forums » archive » Re: Getting the color pallete without calling LoadCT first
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: Getting the color pallete without calling LoadCT first [message #19379] Mon, 20 March 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ricardo Fonseca (zamb@physics.ucla.edu) writes:

> I need to get the color table from one of the default IDL colortables. Right
> now I'm doing it like this:
>
> loadct, ct, NCOLORS = 256
> TVLCT, rr, gg, bb, /get
>
> I was wondering I there was a way to do this without actually loading the
> color pallete i.e. without calling loadct

You can use the Palette object:

theColors = Obj_New('IDLgrPalette')
theColors->LoadCT, ct
theColors, GetProperty, Red=r, Green=b, Blue=b
Obj_Destroy, theColors

Or, you can load and obtain the colors in the Z-buffer,
which is a 256 color device. (This is what I used to do
before objects.)

thisDevice = !D.Name
Set_Plot, 'Z'
LoadCT, ct, /Silent
TVLCT, r, g, b, /Get
Set_Plot, thisDevice

Cheers,

David

--
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
[Message index]
 
Read Message
Read Message
Previous Topic: better 3D surfaces ?
Next Topic: Re: cshell script question

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

Current Time: Sat Oct 11 14:42:56 PDT 2025

Total time taken to generate the page: 0.63933 seconds