From: Avram Dorfman Date: 2007-11-30T20:01:51+09:00 Subject: Re: Convert HEX to RGB Sweet. That is *so* much more readable. Thank you. Eust叩quio 'TaQ' Rangel wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > >> Ummm... This is a really clever solution, except if you have a hex value >> that you need to convert into an rgb array, it is probably a string, not >> an integer literal. Is there an easy way to convert a hex string >> directly into an integer literal? > > Gimme a good and old blue RGB: > >>> "101aff".scan(/../).map {|color| color.to_i(16)} > => [16, 26, 255] > -- Posted via http://www.ruby-forum.com/.