How do I find the rgb values for colors defined by their name: e.g. blue, green, yellow etc.

James Hurley jhurley0305 at sbcglobal.net
Tue Dec 10 21:44:35 EST 2013


Thanks Pete (and Walt and Richard),

That is perfect. Very imaginative. (*But* *why* *all* *the* *asterisks?)

(Replace “*” with space in …..)

And about that Template Button, Riichard. I speak only Pigeon LC.

Jim



> Message: 11
> Date: Mon, 9 Dec 2013 16:17:33 -0800
> From: Peter Haworth <pete at lcsql.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Re: How do I find the rgb values for colors defined by their
> 	name:	e.g. blue, green, yellow etc.
> Message-ID:
> 	<CAGDT7eO20g9REdf+JzXC4qn_YceC58CHrVNG9Y_adkwRMaQkPA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> I'll try that again with better formatting:
> 
> *function* RGBFromColorName theColor
>   *if* theColor is not a color *then* *return* "Error: not a color"
>   *create* invisible button
>   *if* the result is not empty *then* *return* "Error"
>   *set* the backgroundColor of last button to theColor
>   *set* the backgroundPixel of last button to the backgroundPixel of last
> button
>   *get* the backgroundColor of last button
>   *delete* last button
>   *return* it
> *end* RGBFromColorName
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> 
> 





More information about the use-livecode mailing list