RGB valuesfor a color name

James Hurley jhurley0305 at sbcglobal.net
Sat Jul 4 14:17:00 EDT 2009


>
> Message: 16
> Date: Fri, 03 Jul 2009 14:05:15 -0700
> From: Scott Rossi <scott at tactilemedia.com>
> Subject: Re: RGB valuesfor a color name
> To: Revolution Mail List <use-revolution at lists.runrev.com>
> Message-ID: <C673C09B.42E89%scott at tactilemedia.com>
> Content-Type: text/plain;	charset="US-ASCII"
>
> Recently, James Hurley wrote:
>
>> I'm surprise that mouseColor is the only function that returns the  
>> RGV
>> values of named colors.
>
> This is the way I do it (requires an object).  Starting with a  
> graphic, for
> example:
>
> set the backColor of grc 1 to <colorname>
> set the backPixel of grc 1 to the effective backPixel of grc 1
> get the backcolor of grc 1
>
> Not sure why it works, but it does for me.
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design
>
>

Scott,

Thanks for this. It is easier than using the pencolor, even if it does  
require a preexisting object.
It seem particularly appropriate that an object carrying the color  
"WhiteSmoke",  for example, should exist before being defined by its  
RGB values.

In an effort to probe the mysteries of "backpixel" and "effective  
backPixel" I included a couple of extra lines of code:

       put the backPixel of grc tName into tempBack
       put the effective backPixel of grc tName into effectiveTempBack
       set the backPixel of grc tName to the effective backPixel of  
grc tName

I discovered that tempBack and effectiveTempBack are the same and, in  
this instance,  equal to 16711680.

And so it is with all existential questions that they be mysterious:  
"In the beginning was the engine, and the engine was with Scott  
(Rainey)"

Jim Hurley 
   



More information about the use-livecode mailing list