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

Home » Public Forums » archive » Re: problem with Fanning's getcolor
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: problem with Fanning's getcolor [message #59953 is a reply to message #59944] Mon, 21 April 2008 12:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Conor writes:

> well... maybe not. I've included getcolor in a larger program that
> some of my collaborators are using. At the moment it seems to be
> breaking the program. I'm calling:
>
> test = getcolor('red')
>
> and it is returning a [255,0,0] The problem is that I was expecting a
> long integer, not an array. What conditions are causing it to return
> an array with three elements? I thought it always returned an
> integer.

Well, first of all, I wouldn't be using GETCOLOR. I would
be using FSC_COLOR. GETCOLOR is at least 10 years old and
was abandoned years ago.

That said, unless you tell GetColor where to load the color
by specifying the index (which no one did, which is why I
wrote FSC_COLOR), then it returns a color triple, which
presumably you can load where you want to load it.

The program works like this:

IDL> Device, Decomposed=0
IDL> print, getcolor('yellow, 20)
20
IDL> print, getcolor('yellow')
255
255
0
IDL> Device, Decomposed=1
IDL> print, getcolor('yellow')
65535

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Saving Workbench Layout?
Next Topic: Dialog_pickfile problem

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

Current Time: Sat Oct 11 09:05:09 PDT 2025

Total time taken to generate the page: 1.03845 seconds