The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Getting color name from index

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mike Buess Posted - 10/03/2002 : 10:54:48 AM
Labtalk's color() function returns the index of a named color...

color(Blue)=;
COLOR(BLUE)=4

How can I get a color's name if I know its index? (An Origin C solution would be fine.)

...Here is a trivial example of what I would like to do.

get %C -c ii;
// Now assign the name of the iith color to the string variable %A
type The active data set is %A.;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/03/2002 11:07:11 AM
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 10/04/2002 : 8:01:32 PM
Thanks, Laurie.

Here's a related question. You can put the color list in a getnumber dialog's drop-down list...

getn ( ) ii:@C (Pick a color);

Can you do the same thing with Dialog Builder's combo box, list box or list control?

Mike Buess
Origin WebRing Member
Laurie Posted - 10/03/2002 : 5:15:07 PM
Hi Mike,

You could create a string that would contain the default color list. You could then parse this string based on the color index number.

If the user edited the color palette, then the information would be saved to the origin.ini file. You could use the INI object to read from this file.

There isn't a LabTalk command or an Origin C function that will return the name from the index.

Hope this helps,
Laurie

OriginLab Technical Support

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000