##
for my $i (0..3) {
####
for ($x = 0; $x < 3; $x++) {
$rand = rand(255);
$hex[$x] = sprintf ("%x", $rand);
if ($rand < 9) {
$hex[$x] = "0" . $hex[$x];
}
if ($rand > 9 && $rand < 16) {
$hex[$x] = "0" . $hex[$x];
}
}
$colors[$i] = "\#" . $hex[0] . $hex[1] . $hex[2];
}
####
$hex[$_] = sprintf "%02x", rand(255) for 0..2;
####
$color[$_] = sprintf "#%02x%02x%02x", rand 255, rand 255, rand 255 for 0..4;