<div class="section">
<:
use 5.010;
-use Shiar_Sheet::Colour '1.03';
+use Shiar_Sheet::Colour '1.04';
use List::Util qw( min max );
my $palettes = do 'termcol.inc.pl';
for my $b (0 .. $dim - 1) {
my @rgb = ($r, $g, $b);
- my $h = Shiar_Sheet::Colour->new(@rgb)->hue * $hmax;
- my $v = max(@rgb);
- my $s = abs(min(@rgb) - max(@rgb));
+ my ($h, $s, $v) = Shiar_Sheet::Colour->new(@rgb)->hsv;
if (!$s) {
if (@greymap) {
next;
}
- $h = $hmax; # greyscale hue
+ $h = 1; # greyscale hue
$s = 1; # lowest saturation for other hues
$v = $s = $vmax if !$v; # black at full saturation
}
+ $h *= $hmax;
$v = $vmax - $v;
$s = $smax - $s - $v;