4 use Shiar_Sheet::Colour '1.05';
10 for my $path (glob 'data/xcolors/themes/*') {
11 open my $theme, '<', $path;
12 (my $name = $path) =~ s{.*/}{}; # basename
15 while (readline $theme) {
16 m{ color(\d+) \h* : \h* ( \#(\S+) | rgb:(\S+) ) }x or next;
17 my ($idx, $val) = ($1, uc $+);
19 $val =~ s/[^0-9A-F]//g;
26 grep { ($_->hsv)[1] > 32 } # ignore unsaturated
27 map { Shiar_Sheet::Colour->new($_) }
31 $huesum += abs($lasthue - $hue) > .02 if defined $lasthue;
34 $huesum > 3 or next; # require number of significant hue changes
35 #TODO tweak to include good-pants, exclude cheesecake-*
38 say qq(\ttitle => '$name',);
39 say qq(\tparent => 'cga',);
40 say qq(\tlist => [qw(@pal)],);
45 say 'xcolor => [', join(', ', map {"'$_'"} @names), '],';