termcol: list 256-colour hues starting with red
[sheet.git] / termcol.plp
index 74bcbc4ae7f7fde7044bdc5f5a9f927e2b2c88b3..5a4e83eed9b4b285bdfdb2edcdd55f3fad308da0 100644 (file)
@@ -28,7 +28,7 @@ print
 
 <div class="section">
 <:
-use Shiar_Sheet::Colour '1.02';
+use Shiar_Sheet::Colour '1.03';
 use List::Util qw( min max );
 
 sub colcell {
@@ -259,18 +259,17 @@ for my $r (0 .. 5) {
                        my $index = $r*6*6 + $g*6 + $b + 16;
                        my @rgb = map { $_ && $_*40 + 55 } $r, $g, $b;
 
-                       my $h = Shiar_Sheet::Colour->new(@rgb)->hue * 35;
+                       my $h = Shiar_Sheet::Colour->new(@rgb)->hue * 33;
                        my $v = int(max(@rgb) / 255 * 5);
                        my $s = abs(min(@rgb) - max(@rgb)) / 255 * 7;
                        my $grey = !$s;
 
-                       $h-- for grep {$h >= $_} 4, 6, 16, 19, 28, 31;
                        $v = 5 - $v;
                        $s = 7 - $s - $v;
                        $s-- if $s;
 
                        if ($grey) {
-                               $h = 30;  # greyscale hue
+                               $h = 33;  # greyscale hue
                                $s -= 2;  # lowest saturation for other hues
                                $v = $s = 0 if $s < 0;  # black at full saturation
                        }
@@ -283,7 +282,7 @@ for my $r (0 .. 5) {
 {
        print '<table class=mapped>';
        printf '<colgroup span=%d>', 3 * @{$_} for @colmap;
-       for my $h (0 .. 30) {
+       for my $h (grep { $colmap[0][0][$_] } 0 .. $#{ $colmap[0][0] }) {
                print '<tr>';
                print colcell(@$_) for map { $_->[$h] } map { @{$_} } @colmap;
        }