git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a4fdefa
)
termcol: append greyscale ramps to colour tables
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 1 Nov 2015 02:34:10 +0000
(
03:34
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 10 Nov 2015 21:24:03 +0000
(22:24 +0100)
termcol.plp
patch
|
blob
|
history
diff --git
a/termcol.plp
b/termcol.plp
index fd2bc9bf0107d36fd2f5c3ff21ef6c3a967c39b3..60afba6d564e5dac1829d8f3bcfa88795eceed70 100644
(file)
--- a/
termcol.plp
+++ b/
termcol.plp
@@
-281,14
+281,13
@@
sub coltable_hsv {
$out .= '<tr>';
$out .= colcell(@$_) for map { $_->[$h] } map { @{$_} } @colmap;
}
$out .= '<tr>';
$out .= colcell(@$_) for map { $_->[$h] } map { @{$_} } @colmap;
}
- $out .= "</table>\n\n";
$offset += $dim ** 3;
$greymap{$offset++} = $_ for @{$greyramp};
$offset += $dim ** 3;
$greymap{$offset++} = $_ for @{$greyramp};
- $out .= '<t
able
>';
+ $out .= '<t
body
>';
my $col = 0;
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 .= '<tr>' unless $col++ % $colbreak;
$out .= colcell($num, ($greymap{$num}) x 3);
for my $num (sort { $greymap{$a} <=> $greymap{$b} } keys %greymap) {
$out .= '<tr>' unless $col++ % $colbreak;
$out .= colcell($num, ($greymap{$num}) x 3);