in reply to Color Converstion

This will give you three hex numbers.
my ($b,$g,$r) = sprintf('%06x', $color) =~ /(..)/g;
This will give you a single hex RGB value:
my $hexrgb = join '', reverse sprintf('%06x', $color) =~ /(..)/g;

The PerlMonk tr/// Advocate