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
Topic
Mike Buess
USA
3037 Posts
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 ii
th
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
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
Mike Buess
USA
3037 Posts
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
Topic
New Topic
Reply to Topic
Printer Friendly
Jump To:
Select Forum
Origin Forum
Origin Forum
Origin Viewer Forum
Origin Forum for Programming
Forum for Python
LabTalk Forum
Forum for Origin C
Forum for Automation Server/COM and LabVIEW
Origin中文论坛
Origin 中文论坛 (Chinese Origin Forum)
Japanese Origin Forum
Origin日本語フォーラム (Japanese Origin Forum)
Origin on Linux
The Origin on Linux Forum
Private Forums
Distributor Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000