From a8d6bfee7b0542db16ff7da26d06760e95fa4d14 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 1 Nov 2015 04:03:20 +0100 Subject: [PATCH 1/1] termcol: default values for rgb table colours Continue with an equally distributed palette if unspecified. --- termcol.plp | 2 ++ 1 file changed, 2 insertions(+) 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] -- 2.30.0