From: Mischa POSLAWSKY Date: Tue, 13 Oct 2009 19:59:03 +0000 (+0000) Subject: termcol: code cleanup (mostly break wide lines) X-Git-Tag: v1.3~109 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/ddda836ae83e6ffc5fa9f0b60afc03a3b99ae9e7 termcol: code cleanup (mostly break wide lines) --- diff --git a/termcol.plp b/termcol.plp index 2674fc9..24f9550 100644 --- a/termcol.plp +++ b/termcol.plp @@ -48,7 +48,7 @@ sub colcell { } my %col = ( - -name => [ + -html => [ qw/black maroon green olive navy purple cyan silver gray red lime yellow blue fuchsia aqua white/, qw/reset bold dim italic underline blink fastblink @@ -83,7 +83,7 @@ for my $term (qw/html cga xterm tango/) { for my $num (0 .. 15) { my $rgb = $col{$term}[$num + 2]; print '', - colcell($term eq 'html' ? $col{-name}[$num] : $num, $rgb, $col{$term}[0]); + colcell($col{"-$term"}[$num] || $num, $rgb, $col{$term}[0]); } print "\n\n"; } @@ -97,17 +97,18 @@ for my $r (0 .. 3) { for my $g (0 .. 3) { print ''; for my $b (0 .. 3) { - print colcell($r*4*4 + $g*4 + $b + 16, map {(0, 139, 205, 255)[$_]} $r, $g, $b); + 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 '
  • ', map { colcell(80, ($_) x 3) } 46, 92, 115, 139, 162, 185, 208, 231; +print '
  • '; +print colcell(80, ($_) x 3) for 46, 92, 115, 139, 162, 185, 208, 231; print "
    \n\n"; -:>
  • - +:>

    256-colour space

    +:>