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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Getting color name from index
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Mike Buess

USA
3037 Posts

Posted - 10/03/2002 :  10:54:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Laurie

USA
404 Posts

Posted - 10/03/2002 :  5:15:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/04/2002 :  8:01:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000