From 5348c0a9f077660a1495942ad1f977baeccf4a0c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 1 Nov 2015 01:38:31 +0100 Subject: [PATCH] termcol: generate 88-colour map using common function --- termcol.plp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/termcol.plp b/termcol.plp index d945079..18593ab 100644 --- a/termcol.plp +++ b/termcol.plp @@ -228,22 +228,10 @@ for my $term (@termlist) {

88-colour space

<: -for my $r (0 .. 3) { - print ''; - for my $g (0 .. 3) { - print ''; - for my $b (0 .. 3) { - my $index = $r*4*4 + $g*4 + $b + 16; - print colcell($index, map {(0, 139, 205, 255)[$_]} $r, $g, $b); - } - } - print "
\n"; -} -print "\n"; - -print ''; -print colcell(80+$_, (($_ + 2 + ($_>0)) * 255/11) x 3) for 0 .. 7; -print "
\n\n"; +print coltable_hsv(4, + sub {(0, 139, 205, 255)[$_]}, + [map { ($_ + 2 + ($_>0)) * 255/11 } 0 .. 7], +); :>
<: if ($ENV{PATH_INFO} =~ /256/) { :> -- 2.30.0