From: Mischa POSLAWSKY Date: Sun, 1 Nov 2015 02:34:10 +0000 (+0100) Subject: termcol: append greyscale ramps to colour tables X-Git-Tag: v1.9~92 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/305b277a4f33d11dce040fa2a9a1395000f50d27 termcol: append greyscale ramps to colour tables --- diff --git a/termcol.plp b/termcol.plp index fd2bc9b..60afba6 100644 --- a/termcol.plp +++ b/termcol.plp @@ -281,14 +281,13 @@ sub coltable_hsv { $out .= ''; $out .= colcell(@$_) for map { $_->[$h] } map { @{$_} } @colmap; } - $out .= "\n\n"; $offset += $dim ** 3; $greymap{$offset++} = $_ for @{$greyramp}; - $out .= ''; + $out .= ''; my $col = 0; - my $colbreak = keys(%greymap) / 2; # split into 2 rows + my $colbreak = scalar map { @$_ } @colmap; # same width as hue rows for my $num (sort { $greymap{$a} <=> $greymap{$b} } keys %greymap) { $out .= '' unless $col++ % $colbreak; $out .= colcell($num, ($greymap{$num}) x 3);