git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
termcol: float text samples in cells
[sheet.git]
/
termcol.plp
diff --git
a/termcol.plp
b/termcol.plp
index 0c5d3e4d27819484ea19e4c54a047b2939bfea43..0b3d2364a11ed39824afd06ca979833a12ea0f1f 100644
(file)
--- a/
termcol.plp
+++ b/
termcol.plp
@@
-49,7
+49,7
@@
my $palettes = do 'termcol.inc.pl';
die "Cannot open palette data: $_\n" for $@ || $! || ();
sub colcell {
die "Cannot open palette data: $_\n" for $@ || $! || ();
sub colcell {
- my $name = shift // return "<td
colspan=3
>\n";
+ my $name = shift // return "<td>\n";
my $col = Shiar_Sheet::Colour->new(@_);
my $minhex = $col->rgb24;
my $css = '#' . $col->rgb48;
my $col = Shiar_Sheet::Colour->new(@_);
my $minhex = $col->rgb24;
my $css = '#' . $col->rgb48;
@@
-58,13
+58,14
@@
sub colcell {
my $sample = [ qw(#000 #FFF) ];
($name, $sample) = @$name if ref $name eq 'ARRAY';
my $sample = [ qw(#000 #FFF) ];
($name, $sample) = @$name if ref $name eq 'ARRAY';
- my $out = sprintf('<t
h
title="%s" style="%s">%s',
+ my $out = sprintf('<t
d
title="%s" style="%s">%s',
join(',', map { int } @$col),
"background:$css; color:$inverse",
$name,
);
join(',', map { int } @$col),
"background:$css; color:$inverse",
$name,
);
- $out .= sprintf '<td style="%s">%s', "background:$_; color:$css", $minhex
- for @$sample;
+ $out .= sprintf('<samp style="%s"><small>%s</small></samp>',
+ "background:$_; color:$css", $minhex
+ ) for @$sample;
return "$out\n";
}
return "$out\n";
}
@@
-149,7
+150,7
@@
sub coltable_hsv {
}
my $out = '';
}
my $out = '';
- $out .= sprintf '<colgroup span=%d>',
3 *
@{$_} for @colmap;
+ $out .= sprintf '<colgroup span=%d>',
scalar
@{$_} for @colmap;
my $huerow = $colmap[0][0]; # first {$_} map { @{$_} } @colmap;
for my $h (grep { $huerow->[$_] } 0 .. $#{$huerow}) {
$out .= '<tr>';
my $huerow = $colmap[0][0]; # first {$_} map { @{$_} } @colmap;
for my $h (grep { $huerow->[$_] } 0 .. $#{$huerow}) {
$out .= '<tr>';