Html({
title => ($Request ? 'terminal colour' : 'colour palettes') . ' cheat sheet',
- version => '1.1',
+ version => '1.2',
description => [!$Request ? "Comparison of various colour palettes." : (
"Index of all terminal/console colour codes,",
"with an example result of various environments.",
});
my @draw = map { [$_, s/\W+\z//] } grep { $_ } split m(/),
- $get{img} // exists $get{img} && 'indi.png';
+ $get{img} // exists $get{img} && 'compile.png';
my @termlist;
push @termlist, split /\W+/, $Request || 'default';
use POSIX qw( ceil );
my $palettes = do 'termcol.inc.pl';
-die "Cannot open palette data: $_\n" for $@ || $! || ();
+Abort("Cannot open palette data", 501, $_) for $@ || $! || ();
sub colcell {
my $name = shift // return "<td>\n";
my $num = $row + $col * $rows;
my ($rgb, $name) = split /:/, $colours->[$num], 3;
$name //= $rgb && $num;
- $name = [ $name, [] ] if $term =~ /^msx/ and !$num;
+ $name = [ $name, [] ] if $term =~ /^msx/ and !$name; # no bg for transparency
$name = [ $name, ['#333'] ] if $term eq 'xkcd';
print colcell($name, $rgb);
}