X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/87b84f183ea2518e7cf0505bcfee8a444983442b..f84c3bb1e0064bf67ef06f6d729f9cfce0a16299:/termcol.plp diff --git a/termcol.plp b/termcol.plp index 8f8878b..3f8befc 100644 --- a/termcol.plp +++ b/termcol.plp @@ -42,6 +42,8 @@ use POSIX qw( ceil ); my $palettes = do 'termcol.inc.pl'; die "Cannot open palette data: $_\n" for $@ || $! || (); +my $more = do 'termcol-xcolor.inc.pl'; +$palettes = {%$palettes, %$more}; sub colcell { my $name = shift // return "\n"; @@ -129,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"; }