From: Mischa POSLAWSKY Date: Sun, 1 Nov 2015 03:03:20 +0000 (+0100) Subject: termcol: default values for rgb table colours X-Git-Tag: v1.9~88 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/a8d6bfee7b0542db16ff7da26d06760e95fa4d14 termcol: default values for rgb table colours Continue with an equally distributed palette if unspecified. --- diff --git a/termcol.plp b/termcol.plp index e34cead..ead8cb5 100644 --- 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]