git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perl: deobfuscate the year of v5.8 stability end
[sheet.git]
/
tools
/
mktermcol-xcolor
diff --git
a/tools/mktermcol-xcolor
b/tools/mktermcol-xcolor
index 112dd833a6cebff8004623f6b075ff18d8d7b32b..c59b7312150ad163228069163583243044450790 100755
(executable)
--- a/
tools/mktermcol-xcolor
+++ b/
tools/mktermcol-xcolor
@@
-1,11
+1,14
@@
#!/usr/bin/env perl
#!/usr/bin/env perl
-use 5.010;
-
-use Shiar_Sheet::Colour '1.05';
+use 5.014;
+use warnings;
+use lib $0 =~ s{[^/]+$}{..}r; # project root
+use Shiar_Sheet::Colour 1.05;
+say "# automatically generated by $0";
say 'use strict;';
say '+{';
my @names;
say 'use strict;';
say '+{';
my @names;
+my %seen;
for my $path (@ARGV) {
open my $theme, '<', $path or do {
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-*
$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',);
say qq("$name" => {);
say qq(\ttitle => '$name',);
say qq(\tparent => 'cga',);