in reply to Hex to array conversion

This little program can do the conversion:

#!/usr/bin/perl use warnings; use strict; my $rgb = shift; $rgb = oct($rgb); my $first = ( $rgb & 0xff0000 ) >> 16; my $second = ( $rgb & 0x00ff00 ) >> 8; my $third = ( $rgb & 0x0000ff ); print " ( $first , $second , $third )";
And the output is:

C:\Code>perl rgbshift.pl 0xff00ff ( 255 , 0 , 255 )