#!/usr/bin/perl -w # # HTML Color Generator # by Rob Hudson (elihu@atdot.org) # June 1, 1999 use strict; my @colors; for (my $i = 0; $i < 64; $i++) { my ($rand,$x); my @hex; 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]; } print "Content-type: text/html\n\n"; print "Random Color Generator"; print "\n"; print "

Random Color Generator

"; print "\n"; my $count = 0; for (my $i = 0; $i < 8; $i++) { print "\n"; for (my $x = 0; $x < 8; $x++) { print ""; } print "\n"; $count -= 8; for (my $y = 0; $y < 8; $y++) { print "\n"; } print "\n"; } print "
$colors[$count++]
 
 
";