X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/8b8c77dbf30f70a1e8ade679a62f08e130f959a2..9a4d89685edcb4399aa500d38de84b0101ad09b2:/termcol.plp diff --git a/termcol.plp b/termcol.plp index 446b9c5..ad6ae77 100644 --- a/termcol.plp +++ b/termcol.plp @@ -1,28 +1,24 @@ -<: -use utf8; -use strict; -use warnings; -use open IO => ':utf8'; -use List::Util 'min'; - -our $VERSION = 'v1.0'; +<(common.inc.plp)><: -$header{content_type} = 'text/html; charset=utf-8'; - -:> - +Html({ + title => 'terminal colour cheat sheet', + version => 'v1.0', + description => [ + "Index of all terminal/console colour codes,", + "with an example result of various environments.", + ], + keywords => [qw' + color code terminal console escape table xterm rxvt + '], + stylesheet => [qw'light dark'], +}); - -terminal colour cheat sheet - - - +use List::Util 'min'; - +:>

Terminal colours

- +:>
-

88-colour space

+ +:> +<: if ($ENV{PATH_INFO} =~ /256/) { :> +
+ +
+

256-colour space

+<: +for my $r (0 .. 5) { + print ''; + for my $g (0 .. 5) { + print ''; + for my $b (0 .. 5) { + my $index = $r*6*6 + $g*6 + $b + 16; + print colcell($index, map { $_ && $_*40 + 55 } $r, $g, $b); + } + } + print "
\n"; +} +print "\n"; + +for my $row (0, 12) { + print ''; + print colcell(232+$_, ($_*10 + 8) x 3) for $row .. $row+11; + print "
\n"; +} +print "\n"; + +:>
+<: } :> +