Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Random Color Generator

by salvadors (Pilgrim)
on Dec 31, 2000 at 16:31 UTC ( #49093=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://49093]
help
Chatterbox?
and a soft breeze sighs...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2017-11-24 04:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (343 votes). Check out past polls.

    Notices?