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

Home » Public Forums » archive » Current color table
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: Current color table [message #91525 is a reply to message #91486] Thu, 23 July 2015 15:03 Go to previous messageGo to previous message
jimuba is currently offline  jimuba
Messages: 9
Registered: February 2009
Junior Member
On Monday, July 20, 2015 at 10:59:28 AM UTC-6, a1463...@gmail.com wrote:
> When the user clicks a button, the program executes xloadct, allowing them to then select and/or modify a color table. I would like to have a small piece of text below the button that indicates the currently loaded color table. Where would the current color table index and its name be stored? I can't find it anywhere. I also need the table number to preserve the current color table, as the script executes a color plot, and then a different plot which must be black and white. In between runs I don't want the user to have to reselect the color table, but unfortunately it is reverted to black and white to properly generate the second plot. There's probably something simple I am missing...

Hi, would an approach like the following work for you?

xloadct, /block
tvlct, r, g, b, /get
loadct, get_names=ctnames
tvlct, r, g, b, /get
ct = [[r],[g],[b]]

for i=0, n_elements(ctnames)-1 do $
if array_equal(ct, colortable(i)) then begin
print,strtrim(i,1),' : ',ctnames[i]
break
endif

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: External development: Populating a complex array in C
Next Topic: HELP adding arrays

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

Current Time: Wed Oct 08 11:43:51 PDT 2025

Total time taken to generate the page: 0.00523 seconds