From 4df29062a0012a9864d1038557d9f825b7cf509f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 1 Nov 2015 04:05:06 +0100 Subject: [PATCH] termcol: omit table tags from coltable_hsv() output Require manual container setup so e.g. captions can be added. --- termcol.plp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/termcol.plp b/termcol.plp index 9262bf3..e34cead 100644 --- a/termcol.plp +++ b/termcol.plp @@ -261,7 +261,7 @@ sub coltable_hsv { } } - my $out = ''; + my $out = ''; $out .= sprintf '', 3 * @{$_} for @colmap; my $huerow = $colmap[0][0]; # first {$_} map { @{$_} } @colmap; for my $h (grep { $huerow->[$_] } 0 .. $#{$huerow}) { @@ -279,25 +279,28 @@ sub coltable_hsv { $out .= '' unless $col++ % $colbreak; $out .= colcell($num, ($greymap{$num}) x 3); } - $out .= "
\n\n"; return $out; } { print "

88-colour space

\n"; + print "\n"; print coltable_hsv(4, sub {(0, 139, 205, 255)[$_[0]]}, [map { ($_ + 2 + ($_>0)) * 255/11 } 0 .. 7], ); + print "
\n"; } if ($ENV{PATH_INFO} =~ /256/) { print "

256-colour space

\n"; + print "\n"; print coltable_hsv(6, sub { $_[0] && $_[0]*40 + 55 }, [ map { $_ * 10 + 8 } 0 .. 23 ], ); + print "
\n"; } :>
-- 2.30.0