X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/dae21a09b01baa118720670247a87c5cdc2591b8..040b34c73c69215ef3a93a474fd46cae3a622033:/termcol.plp diff --git a/termcol.plp b/termcol.plp index 359b33d..6d69f0c 100644 --- a/termcol.plp +++ b/termcol.plp @@ -1,149 +1,271 @@ -<: -use utf8; -use strict; -use warnings; -use open IO => ':utf8'; -use List::Util 'min'; +<(common.inc.plp)><: -our $VERSION = 'v1.0'; +Html({ + title => ($Request ? 'terminal colour' : 'colour palettes') . ' cheat sheet', + version => '1.1', + description => [!$Request ? "Comparison of various colour palettes." : ( + "Index of all terminal/console colour codes,", + "with an example result of various environments.", + )], + keywords => [qw' + color colour code terminal console escape table xterm rxvt + ansi vt100 8bit 4bit cga ega vga rgb hsv game emulator display + '], + 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+/, $Request || 'default'; - -terminal colour cheat sheet - - - +say "

$_

\n" for $Request ? 'Colour palettes' : 'Terminal colours'; - -

Terminal colours

+say '

'; +if ("@termlist" eq 'default') { + say 'ANSI (VT100, ISO-6429) 16-colour text palette'; + say 'as implemented by various systems and programs.'; + say 'Also see 8-bit legacy hardware palettes.'; +} +elsif ("@termlist" eq 'legacy') { + say 'Colour palettes of various 8-bit legacy systems and retro games.'; + say 'Also see ANSI console palettes.'; +} +else { + say 'Comparison of requested colour palettes.'; +} +:> -

-
-

88-colour space

+ if (my $palette = $info->{list}) { + my $colours = colorder($palette, $reorder); -
-

256-colour space

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