Re: color widget [message #26176] |
Fri, 10 August 2001 10:07  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
David made fun of my little hack I put out a while ago, which was doing
exactly that, and promised something sleeker and cooler and of course
object-filled from his own anvil. You better ask the Coyote where it is.
Cheers,
Pavel
Marc Schellens wrote:
>
> I want to let the user interactively select a color.
> Is there some modal dialog, which allows that comfortably
> and returns a three byte vector?
> Ie. I am using object graphics, so there might be problems
> with cw_colorsel and co.
>
> Thanks,
> :-) marc
|
|
|
Re: color widget [message #26274 is a reply to message #26176] |
Fri, 10 August 2001 10:53  |
david[2]
Messages: 100 Registered: June 2001
|
Senior Member |
|
|
Pavel A. Romashkin writes:
> David made fun of my little hack I put out a while ago, which was doing
> exactly that, and promised something sleeker and cooler and of course
> object-filled from his own anvil. You better ask the Coyote where it is.
> Cheers,
> Pavel
>
> Marc Schellens wrote:
>>
>> I want to let the user interactively select a color.
>> Is there some modal dialog, which allows that comfortably
>> and returns a three byte vector?
>> Ie. I am using object graphics, so there might be problems
>> with cw_colorsel and co.
>>
>> Thanks,
>> :-) marc
My news source seems to be dropping every third
article these days, so I didn't see this article
from Marc Schellens. (Perhaps this is a message
from the gods that I should play more tennis.)
But I've got all *kinds* of color tools!
I recommend FSC_COLOR. Out of the box, this
program knows 88 color "names" that I use for
all manner of drawing colors. (If you don't
like the 88 I've selected for you, you can
easily load your own in the program.) It will
instinctively return a color triple on a 24-bit
display device, but you can force it to *always*
return the color triple by setting the TRIPLE
keyword:
IDL> Print, FSC_COLOR('yellow', /Triple)
255 255 0
If you want the user to see the colors and select
one from the available colors, then simple use the
SELECTCOLOR keyword:
IDL> theColor = FSC_COLOR('Indian Red', $
/SelectColor, /Triple)
Specifying a group leader, will make the program
modal:
theColor = FSC_COLOR('Indian Red', $
/SelectColor, /Triple, Group_Leader=event.top)
I use this program in every widget program I write,
whether object graphics or direct graphics. I don't
know how anyone lives without it. :-)
You will need the PICKCOLORNAME program too:
http://www.dfanning.com/programs/fsc_color.pro
http://www.dfanning.com/programs/pickcolorname.pro
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
|
|
|