#! perl -sw use strict; use CGI qw/:standard *table/; use CGI::pretty; sub Dlighken { return sprintf '%02x'x3, map{ ($_ *= 1+$_[1]) > 0xff ? 0xff : $_ } map hex, unpack 'A2'x3, $_[0]; } my @colors = qw/800000 808000 008000 008080 000080 808080 c0c0c0/; print table( Tr( th(' '), th([@colors]) ), map{ my $scale = $_/10; Tr( td($_), map{ td({bgcolor=>"$_"},[$_]) } map{ Dlighken($_, $scale) } @colors ) }( -5 .. +5 ) ) ; __END__