index: release v1.18 with only altgr index linked
[sheet.git] / tools / mktermcol-xcolor
index 615bff28676e79e2b8e4ab3cb9a64c2f5959f1fd..c705093924dc96748f18a56683d6863e285a390a 100755 (executable)
@@ -1,11 +1,14 @@
 #!/usr/bin/env perl
-use 5.010;
+use 5.014;
 
+BEGIN { push @INC, '.'; }
 use Shiar_Sheet::Colour 1.05;
 
+say "# automatically generated by $0";
 say 'use strict;';
 say '+{';
 my @names;
+my %seen;
 
 for my $path (@ARGV) {
        open my $theme, '<', $path or do {
@@ -40,6 +43,13 @@ for my $path (@ARGV) {
        $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;
+       }
+
+       splice @pal, 8 if "@pal[0..7]" eq "@pal[8..15]";
+
        say qq("$name" => {);
        say qq(\ttitle => '$name',);
        say qq(\tparent => 'cga',);