Lol, thanks for reminding me of the source of this, Jacque. I knew I nabbed it from someone. I just couldn't remember whom.
On Tue, Jan 8, 2013 at 10:26 PM, J. Landman Gay <jac...@hyperactivesw.com>wrote: > That's what I use too. Credit to Ken Ray. :) Howard Bornstein < > bornst...@designeq.com> wrote:This is what I use: > > *function* RGBFromColorName theColor > > *if* theColor is not a color *then* *return* "Error: not a color" > > *-- create a temporary object for the color transformation:* > > *create* invisible button > > *if* the result is not empty *then* *return* "Error" > > *set* the backgroundColor of last button to theColor > > *-- transform the color using the backgroundPixel trick:* > > *set* the backgroundPixel of last button to the backgroundPixel of last > button > > *-- the button's backgroundColor is now RGB:* > > *get* the backgroundColor of last button > > *delete* last button *-- don't need the temp object any more* > > *-- the create command automatically chose the pointer* > > *-- tool, so change it back:* > > *send* "choose browse tool" to me in 10 milliseconds > > *return* it > > *end* RGBFromColorName > > -- > Regards, > > Howard Bornstein > ----------------------- > www.designeq.com > On Tue, Jan 8, 2013 at 5:24 PM, Peter Haworth <p...@lcsql.com> wrote: > > > I have a need to convert a color name form LC's colornames property to > its > > equivalent hex value, or rgb value. Can that be done in LC? > > Pete > > lcSQL Software <http://www.lcsql.com> > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode