RGB values for a color name

Richmond Mathewson richmondmathewson at gmail.com
Fri Jul 3 16:01:51 EDT 2009


Phil Davis wrote:
> Depending on your use, maybe this will help:
>
>  set the backgroundColor of control <yourColorObject> to "gray40"
>  set the screenMouseLoc to globalLoc(the loc of <yourColorObject>)
>  put the mouseColor -- puts "102,102,102"
>
> Judging from this and Richmond's reply, it appears you have to do the 
> name-to-triplet translation indirectly, through the setting and 
> getting of an object's properties. But maybe someone else will pipe in...

Ha, Ha, I was suffering from a bad dose of over-confidence there, 
because, if you read the Documentation under COLORS:

"A color reference is any standard color name; or three comma-separated 
integers between zero and 255, specifying the level of each of red, 
green, and blue; or an HTML-style color consisting of a hash mark (#) 
followed by three hexadecimal numbers, one for each of red, green, and 
blue."

There seems no obvious way to get  the RGB reference rather than the name.

The stack I just popped off just gives me the standard color name again.
>
> Phil Davis
>
>
>
> James Hurley wrote:
>> How do I translate a color name (Blue1 for example) into its RGB 
>> values? Programatically.
>>
>> Jim Hurley 
>




More information about the use-livecode mailing list