in reply to Convert RGB to an actual color
You're in luck, CPAN is having a special on rgb.txt: "Color::Rgb - Simple rgb.txt parsing class". The CPAN TGZ includes Rgb.pm and rgb.txt.
(2) Or if you want geometric generalizations and want to code it yourself, Color::Object handles HSV/HSL/RGB conversions, and can give you something not unlike angles in colorspace that you could round, interpret, and convert back.
For background on colorspace stuff and all sorts of graphics processing, check out the Graphic Gems series and source archive and the successor journal jgt. They speak C over there, but it's easily transliterated.
-- bill n1vux
|
---|