X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/f7dc0c4618952f5a64b0bf3097b115d0c799684e..d29916edd5f2af73164483662b5e49fdc6e3e697:/termcol.plp diff --git a/termcol.plp b/termcol.plp index 74bcbc4..5a4e83e 100644 --- a/termcol.plp +++ b/termcol.plp @@ -28,7 +28,7 @@ print
<: -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 ''; printf '', 3 * @{$_} for @colmap; - for my $h (0 .. 30) { + for my $h (grep { $colmap[0][0][$_] } 0 .. $#{ $colmap[0][0] }) { print ''; print colcell(@$_) for map { $_->[$h] } map { @{$_} } @colmap; }