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

Re: Getting the color pallete without calling LoadCT first



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

not really. But why don't you do:
TVLCT, rold, gold, bold, /GET
loadct, ct, NCOLORS=256
TVLCT, rr, gg, bb, /GET
TVLCT, rold, gold, bold

which restores the original one with only two lines extra.

Also: if working on a 8 bit colordepth device you must be careful with
NCOLORS=256,
so perhaps you should select a different device before you do this
(off-hand I know of PS to always support 256 colors -- after
device,bits_per_pixel=8) but you could try others (e.g. the NULL device
??)

Cheers,
Martin

-- 
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[