git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
4df2906
)
termcol: default values for rgb table colours
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 1 Nov 2015 03:03:20 +0000
(
04:03
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 5 Jan 2016 00:05:07 +0000
(
01:05
+0100)
Continue with an equally distributed palette if unspecified.
termcol.plp
patch
|
blob
|
history
diff --git
a/termcol.plp
b/termcol.plp
index e34ceada9d45204cf9af827be33092b71fe5f069..ead8cb5d9e812522967a4c45bed4f0d2b46e533b 100644
(file)
--- a/
termcol.plp
+++ b/
termcol.plp
@@
-233,6
+233,8
@@
sub coltable_hsv {
my $hmax = 2 * $dim * 3; # each face of the rgb cube
my $vmax = $dim - 1;
my $smax = $dim - 1;
+ $rgbval ||= sub { int $_[0] * 255 / $vmax };
+ $greyramp ||= [];
my %greymap; # name => value
my @colmap; # saturation => value => hue => [name, r,g,b]