translating a color name to RGB triplet

Stephen Barncard stephenREVOLUTION at barncard.com
Sat Sep 9 13:34:02 EDT 2006


Somehow the thread has been lost.

The colornames does not give a list of the color RGB triad, just the 
names themselves. In the user-accessible, documented Rev world, there 
is no way shown to CONVERT from color name to RGB triad and 
vice-versa. This is what I was looking for.

Mark Schonewille's suggestion of using revNumbertoColor() appears to 
be the hidden function to do this. It needs to be tested to see if it 
works in a standalone. Otherwise, one might have to dig into a revLib.

Grabbing the X11 list (with decimal RGB triad), putting it into a 
custom property, turning it into an array, and using it to 
cross-reference is really a workaround, reinventing the wheel, as I 
knew using other commands in Rev that used this conversion lived 
somewhere in REV.

This method is covered well in earlier posts by Eric Chatonet:

>About colours convert functions you could have a look at this post: 
>http://lists.runrev.com/pipermail/use-revolution/2005-May/058259.html
>The list of the color names/RGB values are here:
>Part1: 
>http://article.gmane.org/gmane.comp.ide.revolution.user/58156/match=color+names+chatonet
>Part2: 
>http://article.gmane.org/gmane.comp.ide.revolution.user/58157/match=color+names+chatonet


>Stephen-
>
>Friday, September 8, 2006, 12:29:41 PM, you wrote:
>
>>  somewhere within the bowels of Rev must be a way to convert this directly.
>
>>From Mark Waddingham earlier this year:
>
>In terms of the colours themselves, then they come from the standard
>X11 named colour table. One reference for this is at:
>
>http://www.febooti.com/products/iezoom/online-help/html-color-names-x11-color-chart.html
>
>You can access the full list from within Revolution by using the 
>colorNames function.
>
>--
>-Mark Wieder

-- 
stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -



More information about the use-livecode mailing list