git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
charset: cols option to override table width
[sheet.git]
/
tools
/
mktermcol-xcolor
diff --git
a/tools/mktermcol-xcolor
b/tools/mktermcol-xcolor
index f731e5a7048a248eea697134402e7fb0d9ff3036..4dba0bc8724486631775ab91ad6a5bbc2f09e8b5 100755
(executable)
--- a/
tools/mktermcol-xcolor
+++ b/
tools/mktermcol-xcolor
@@
-1,14
+1,18
@@
#!/usr/bin/env perl
#!/usr/bin/env perl
-use 5.01
0
;
+use 5.01
4
;
-use Shiar_Sheet::Colour
'1.05'
;
+use Shiar_Sheet::Colour
1.05
;
say 'use strict;';
say '+{';
my @names;
say 'use strict;';
say '+{';
my @names;
+my %seen;
-for my $path (glob 'data/xcolors/themes/*') {
- open my $theme, '<', $path;
+for my $path (@ARGV) {
+ open my $theme, '<', $path or do {
+ warn "could not open $path: $!\n";
+ next;
+ };
(my $name = $path) =~ s{.*/}{}; # basename
my (%pal, @pal);
(my $name = $path) =~ s{.*/}{}; # basename
my (%pal, @pal);
@@
-37,6
+41,11
@@
for my $path (glob 'data/xcolors/themes/*') {
$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;
+ }
+
say qq("$name" => {);
say qq(\ttitle => '$name',);
say qq(\tparent => 'cga',);
say qq("$name" => {);
say qq(\ttitle => '$name',);
say qq(\tparent => 'cga',);