Bigger clock
[oxy-cursors.git] / svgs / change-colors.pl
blob957ea60785408728a2c507a03e0b3b0a912eef55
1 #!/usr/bin/env perl
3 my $inputDir = "white";
4 my %colorDescription = (
5 # subDirColor lighterColor mediumColor darkerColor
6 "blue" => "#a4c0e4 #00438a #00316e",
7 "brown" => "#debc85 #57401e #382509",
8 "emerald" => "#99dcc6 #00734d #00583f",
9 "green" => "#d8e8c2 #00892c #006e29",
10 "hot_orange" => "#ffd9b0 #cf4913 #ac4311",
11 "navy" => "#c3b4da #34176e #1d0a55",
12 "purple" => "#f9cade #bf0361 #9c0f56",
13 "red" => "#f9ccca #bf0303 #9c0f0f",
14 "sea_blue" => "#a8dde0 #006066 #00484d",
15 "violet" => "#e8b7d7 #85026c #6a0056",
16 "yellow" => "#fff6c8 #f3c300 #e3ad00",
17 # "white" => "#ffffff #d3d7cf #555753"
18 "viorange" => "#fcaf3e #f57900 #ce5c00",
19 "grey" => "#eeeeec #555753 #2e3436"
22 sub convertFile($) {
23 my $inputFile = shift;
24 print "processing " . $inputFile . "\n";
25 foreach my $color (keys %colorDescription) {
26 my @descr = split(' ', $colorDescription{$color});
27 my $lighterColor = $descr[0];
28 my $mediumColor = $descr[1];
29 my $darkerColor = $descr[2];
31 #print $color . " " . $lighterColor . "\n";
32 open(IN, "<$inputDir/$inputFile") or die "$inputDir/$inputFile not found";
33 open(OUT, ">$color/$inputFile") or die "Cannot create $color/$inputFile";
34 while(<IN>) {
35 s/#ffffff;/$lighterColor;/g;
36 s/#d3d7cf/$mediumColor/g;
37 s/#2e3436/$darkerColor/g;
38 print OUT $_;
40 close IN;
41 close OUT;
45 my $argument = $ARGV[0];
46 if ($argument eq "") {
47 print "Usage: $0 [ -a | file.svg ]\n";
48 } elsif ($argument eq '-a') {
49 my @files=`ls -1 $inputDir`;
50 foreach $_ (@files) {
51 chomp;
52 convertFile($_);
54 } else {
55 convertFile($argument);
61 #for icon in $(ls *.svg); do
63 #cp $icon $( echo $icon | sed s/.svg// )-old.svg
65 #perl -pi -e "s/#eeeeec;/$lighterColor;/g" $icon
66 #perl -pi -e "s/fill:#555753;fill-rule:evenodd;stroke:#2e3436;/fill:$mediumColor;fill-rule:evenodd;stroke:$darkerColor;/g" $icon
67 ## perl -pi -e "s/style=\"stop-color:#eeeeec;stop-opacity:1;\"/style=\"stop-color:$lighterColor;stop-opacity:1;\""
68 #done