X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/b10a1871f75e16efe0cf94f05f2f9585ef0a8ea9..cd1aa5e48c47c1830a8e205ee1d7366d7d08c59e:/termcol.plp
diff --git a/termcol.plp b/termcol.plp
index 3d807a2..6f7a55d 100644
--- a/termcol.plp
+++ b/termcol.plp
@@ -2,7 +2,7 @@
Html({
title => 'terminal colour cheat sheet',
- version => '1.0',
+ version => '1.1',
description => [
"Index of all terminal/console colour codes,",
"with an example result of various environments.",
@@ -36,7 +36,7 @@ print
<:
use 5.010;
-use Shiar_Sheet::Colour '1.04';
+use Shiar_Sheet::Colour 1.04;
use List::Util qw( min max );
use POSIX qw( ceil );
@@ -131,14 +131,18 @@ sub coltable {
printf "
%s\n", $caption;
for my $row (@$table) {
print '';
- print colcell(@$_) for @$row;
+ print colcell(ref $_ ? @$_ : $_ ? reverse split /:/ : undef) for @$row;
}
+ if (@draw) {
my $width = scalar @{ $table->[0] };
- my @imgpal = map { [ @{$_}[1 .. 3] ] } map { @{$_} } @{$table};
+ my @imgpal = map {
+ [ ref $_ ? @{$_}[1 .. 3] : map {hex} /(..)(..)(..)/ ]
+ } map { @{$_} } @{$table};
for (@draw) {
print "
", img_egapal(\@imgpal, @{$_});
}
+ }
print "\n\n";
}
|