RGB colours

David Bovill david at openpartnership.net
Wed Dec 19 07:24:40 EST 2007


Now that is a funny script! Thanks Sarah!

On 18/12/2007, Sarah Reichelt <sarah.reichelt at gmail.com> wrote:
>
> On Dec 19, 2007 5:47 AM, David Bovill < david at openpartnership.net> wrote:
> > I want to be able to translate between colorname and rgb tripplets.
> AFAIK
> > there is still no built in way to do this. In the past I created a
> lookup
> > array by setting the bgcolor of an object to  each of the colornames and
>
> > retrieving the bgcolor (which used to be an rgb tripplet) - now however
> I
> > get back the colorname? This seems to have changed from earlier
> versions?
>
> Here is a function I gleaned from the list a long time ago.
>
> function translateColorName pColorName
>    lock screen
>    lock messages
>    create btn "ColorTest"
>    put it into tButtonID
>    set the backcolor of tButtonID to pColorName
>    get the effective backpixel of tButtonID
>    set the backcolor of tButtonID to empty
>    set the backpixel of tButtonID to it
>    put the backcolor of tButtonID into tRGB
>    delete tButtonID
>
>    return tRGB
> end translateColorName
>
>
> HTH,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list