Equivalence of Color names to RGB

Dar Scott dsc at swcp.com
Sat Jul 3 23:31:24 EDT 2004


On Jul 3, 2004, at 9:01 PM, Alejandro Tejada wrote:

> How could i convert the color names to their
> equivalent rgb triplet?

There is probably a better way, but this might work:

Go through colorNames().  For each name, do this:  set the back color 
of a rectangle to that color.  Import a snapshot of the rectangle to an 
image.  Get the imageData.  Find an interior pixel and then convert the 
bytes to rgb triplet.

Dar Scott





More information about the use-livecode mailing list