RGB values for a color name
Richmond Mathewson
richmondmathewson at gmail.com
Fri Jul 3 16:09:25 EDT 2009
Aha, gottit (Thanks for the hint Phil); new version now available at:
http://mathewson.110mb.com/FILEZ/COLORNAMER.rev.zip
Code in list field "KNAMES" changed to:
on mouseDown
get the clickText
put the clickText into fld "SELECT"
set the backgroundColor of grc "KOLOR" to the clickText
end mouseDown
but script now added to graphic "KOLOR":
on mouseDown
put the mouseColor into fld "fRGB"
end mouseDown
so, select your color with its "Campy, House Designer Color" from the
list field; then click on the colored graphic to get its RGB value.
Cripes, its way past my bedtime . . . Love, Richmond.
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...
>
> 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