From 032b7eb4897d7517e94c7fe2e1d414be8d925c9f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 1 Nov 2015 03:50:47 +0100 Subject: [PATCH] termcol: avoid plp code breaks for hsv tables --- termcol.plp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/termcol.plp b/termcol.plp index 189b89c..9262bf3 100644 --- a/termcol.plp +++ b/termcol.plp @@ -226,19 +226,6 @@ for my $term (@termlist) {
-

88-colour space

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

256-colour space

<: sub coltable_hsv { my ($dim, $rgbval, $greyramp) = @_; @@ -297,11 +284,21 @@ sub coltable_hsv { return $out; } -print coltable_hsv(6, - sub { $_[0] && $_[0]*40 + 55 }, - [ map { $_ * 10 + 8 } 0 .. 23 ], -); +{ + print "

88-colour space

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

256-colour space

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