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

Home » Public Forums » archive » Getting the color pallete without calling LoadCT first
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Getting the color pallete without calling LoadCT first [message #19383] Sun, 19 March 2000 00:00 Go to next message
Ricardo Fonseca is currently offline  Ricardo Fonseca
Messages: 13
Registered: February 2000
Junior Member
Hi

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

Thanks in advance, Ricardo
Re: Getting the color pallete without calling LoadCT first [message #19524 is a reply to message #19383] Mon, 20 March 2000 00:00 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Ricardo Fonseca wrote:
>
> Hi
>
> 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
>
> Thanks in advance, Ricardo

The code for reading in the color tables is in loadct and it basically consists
of (modified slightly):

filename = filepath('colors1.tbl', subdir=['resource', 'colors'])
openr,lun, filename, /get_lun
aa=assoc(lun, bytarr(256),1) ;Read 256 long ints
r = aa[table_number*3]
g = aa[table_number*3+1]
b = aa[table_number*3+2]

You can obviously parse them all in at once this way if that's what you're
after.

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: cshell script question
Next Topic: Embedded Font formatting and positioning commands in Object Graphics

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

Current Time: Fri Oct 10 03:39:58 PDT 2025

Total time taken to generate the page: 0.48426 seconds