+ ($name ? $pal{$name} : $pal[$idx]) = $val;
+ }
+
+ my $huesum = 0;
+ for my $hue (
+ sort map { $_->hue }
+ grep { ($_->hsv)[1] > 32 } # ignore unsaturated
+ map { Shiar_Sheet::Colour->new($_) }
+ @pal
+ ) {
+ state $lasthue;
+ $huesum += abs($lasthue - $hue) > .02 if defined $lasthue;
+ $lasthue = $hue;
+ }
+ $huesum > 3 or next; # require number of significant hue changes
+ #TODO tweak to include good-pants, exclude cheesecake-*
+
+ if ($seen{"@pal"}++) {
+ warn "ignore duplicate palette $name\n";
+ next;