<% my ($types, $colors, $hex) = @_; my @headings = ('Attribute', @$colors, 'Hex'); my ($attributes, %values); foreach my $type (@$types) { # Set up the body attributes. $attributes .= qq!$type="#$hex->{$type}" !; # Create the RGB chooser table elements. my @rgb = map{hex} unpack "a2a2a2", $hex->{$type}; foreach my $index (0 .. 2) { $values{$type . $colors->[$index]} = $rgb[$index]; } } %> >

Color Chooser

Enter an RGB value (each between 0 and 255) for the attributes below, and press "Try it!" to see the results.
<% foreach my $heading (@headings) { %> <% } %> <% foreach my $type (@$types) { %> <% foreach my $color (@$colors) { %> <% } %> <% } %>
<% =$heading %>
<% =$type %> <%=$hex->{$type} %>
Here is a link.