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 |