#!/usr/local/bin/perl
#
#	colors.pl
#
#	List colors in html.
#

###
###	Configuration
###

$low_color	= 0;
$top_color	= 256;
$divisions	= 8;
$color_step	= $top_color / $divisions;

###
###	Main program
###


    print "<html>\n";
    print "<body text =#000000 link=#009926 vlink=#ff0000 ALINK=#FF7F00>\n";
    print "<title>Colors Test</title>\n";
    print "<center><h2>Colors Test</h2></center>\n\n";

    for ($red_color = $low_color; 
         $red_color <= $top_color; 
         $red_color += $color_step)
    {
        if ($red_color == $top_color)
        {
            $red_color--;
        }
        for ($green_color = $low_color; 
             $green_color <= $top_color; 
             $green_color += $color_step)
        {
            if ($green_color == $top_color)
            {
                $green_color--;
            }
            for ($blue_color = $low_color; 
                 $blue_color <= $top_color; 
                 $blue_color += $color_step)
            {
                if ($blue_color == $top_color)
                {
                    $blue_color--;
                }
                printf ("<font color=\"#%02X%02X%02X\">%02X%02X%02X</font>\n",
                    $red_color, $green_color, $blue_color,
                    $red_color, $green_color, $blue_color);
            }
            printf "<br>\n";
        }
        printf "<br>\n";
    }

    print "\n</html>\n";

