X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/ddda836ae83e6ffc5fa9f0b60afc03a3b99ae9e7..4df29062a0012a9864d1038557d9f825b7cf509f:/termcol.plp diff --git a/termcol.plp b/termcol.plp index 24f9550..e34cead 100644 --- a/termcol.plp +++ b/termcol.plp @@ -1,147 +1,307 @@ -<: -use utf8; -use strict; -use warnings; -use open IO => ':utf8'; -use List::Util 'min'; - -our $VERSION = 'v1.0'; - -$header{content_type} = 'text/html; charset=utf-8'; - -:> - +<(common.inc.plp)><: - -terminal colour cheat sheet - - - +Html({ + title => 'terminal colour cheat sheet', + version => '1.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 colours

- +:>
-

88-colour space

+ my $out = ''; + $out .= sprintf '', 3 * @{$_} for @colmap; + my $huerow = $colmap[0][0]; # first {$_} map { @{$_} } @colmap; + for my $h (grep { $huerow->[$_] } 0 .. $#{$huerow}) { + $out .= ''; + $out .= colcell(@$_) for map { $_->[$h] } map { @{$_} } @colmap; + } -
-

256-colour space

+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"; +} +:>
- - -