X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/0934eb163565512a7e1622f931a2f6a60b7c0872..0f1bf743dcb721880bbcdaebfc182090ac5f6afa:/termcol.plp diff --git a/termcol.plp b/termcol.plp index c7c74bf..3aece81 100644 --- a/termcol.plp +++ b/termcol.plp @@ -1,132 +1,258 @@ -<: -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 => '1.1', + 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 + '], + data => ['termcol.inc.pl'], + stylesheet => [qw'light dark'], +}); -:> - +my @draw = map { [$_, s/\W+\z//] } grep { $_ } split m(/), + $get{img} // exists $get{img} && 'indi.png'; - -terminal colour cheat sheet - - - +my @termlist; +push @termlist, split /\W+/, $Request || 'default'; - +:>

Terminal colours

- -
-

88-colour space

+sub colorder { + my ($palette, $reorder) = @_; + return [ map { $palette->[$_] =~ s/:(?![^:])|$/:$_/r } @{$reorder} ] + if $reorder; + return $palette; +} -
-

256-colour space

+coltable($_) for @termlist; +:> +