http://www.perlmonks.org?node_id=49093


in reply to Random Color Generator

That's quite a longwinded way of generating the colors array. Especially as you do exactly the same in each part of the 'if'!

I'd use something like:

my @colors = map { join "", map { sprintf "%02x", rand(255) } (0..2) } (0..63);

Tony