X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/0934eb163565512a7e1622f931a2f6a60b7c0872..4f3782455010e83df98953a4fa4f146577b9a888:/termcol.plp diff --git a/termcol.plp b/termcol.plp index c7c74bf..850ff83 100644 --- a/termcol.plp +++ b/termcol.plp @@ -1,132 +1,249 @@ -<: -use utf8; -use strict; -use warnings; -use open IO => ':utf8'; -use List::Util 'min'; +<(common.inc.plp)><: -our $VERSION = 'v1.0'; +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 + '], + data => ['termcol.inc.pl'], + stylesheet => [qw'light dark'], +}); -$header{content_type} = 'text/html; charset=utf-8'; +my @draw = map { [$_, s/\W+\z//] } grep { $_ } split m(/), + $get{img} // exists $get{img} && 'indi.png'; -:> - +my @termlist; +push @termlist, split /\W+/, $ENV{PATH_INFO} || 'default'; - -terminal colour cheat sheet - - - +my %termgroup = ( + default => [qw( ansi xkcd ansi88 )], + more => [qw( ansi mirc legacy ansi256 )], + msx => [qw( msx1 msx2 arnejmp )], + ansi => [qw( cga xterm tango app html cgarne )], + legacy => [qw( c64 msx2 mac2 risc arnegame cpc )], +); +@{$_} = map { $termgroup{$_} ? @{ $termgroup{$_} } : $_ } @{$_} + for values %termgroup, \@termlist; - +:>

Terminal colours

- -
-

88-colour space

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

256-colour space

+:> +