From: Austin Ziegler Date: 2006-08-10T09:45:42+09:00 Subject: Re: Convert HEX to RGB On 8/9/06, Ben Bleything wrote: > On Thu, Aug 10, 2006, Bruno Malvestuto wrote: > "#ffccff".match /#(..)(..)(..)/ > > puts "R: #{m[1].hex}" > puts "G: #{m[2].hex}" > puts "B: #{m[3].hex}" > > That's not going to work in all cases (for instance, it's legal to do > #fff if you mean #ffffff), but it should get you started :) Better yet, use color-tools (gem i color-tools). This is currently part of the Ruby PDF project, but it will be moving to the "color" project in due course. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca