forked from HattDroid/Mint-Y-Colora-Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-change-color.sh
executable file
·84 lines (63 loc) · 2.29 KB
/
1-change-color.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
#
# Prepare light and dark color in hexadecimal format (6 letters or numbers).
# - Never put a hashtag # in front of the colour code if copy/pasting from gpick
# - Never put "FF" at the end if copy/pasting from inkscape
# Use color values as scrpt arguments in format "1-change-color.sh LIGHT_COLOR DARK_COLOR"
# - example: ./1-change-color.sh 9ab87c 8fa876
#
# path to Mint-Y source
SRC_DIR="src/Mint-Y"
# get new colors
personallightcolour=$1
personaldarkcolour=$2
if [ $# -ne 2 ]; then
echo "ERROR! Missing (or incorect number of) color values! Using default colors!"
# these are orginal colors
personallightcolour=9ab87c
personaldarkcolour=8fa876
fi
echo "All css files but also svg files will be affected"
echo "PNG'S will not be altered with this script"
echo "Changing ....."
#original light version is #9ab87c
oldcolour1=9ab87c
#original dark version is #8fa876
oldcolour2=8fa876
#other colour variations in svg
oldcolour3=779559
# other colours that were missed
oldcolour4=92b372
oldcolour5=afca95
newcolour1=$personallightcolour
newcolour2=$personaldarkcolour
newcolour3=$personaldarkcolour
newcolour4=$personallightcolour
newcolour5=$personallightcolour
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour1'/'$newcolour1'/g' {} \;
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour2'/'$newcolour2'/g' {} \;
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour3'/'$newcolour3'/g' {} \;
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour4'/'$newcolour4'/g' {} \;
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour5'/'$newcolour5'/g' {} \;
#Rubberband Solution for now
#border
oldcolour1=76905b
find $SRC_DIR -type f -exec sed -i 's/'$oldcolour1'/'$newcolour1'/g' {} \;
#background of rubberband is in rgba
#from hex to decimal
redhex=${newcolour1:0:2}
greenhex=${newcolour1:2:2}
bluehex=${newcolour1:4:2}
reddec=$((16#$redhex))
greendec=$((16#$greenhex))
bluedec=$((16#$bluehex))
rgbacolour="$reddec, $greendec, $bluedec"
#old rgba colour of background rubberband
oldcolour1="118, 144, 91"
newcolour1=$rgbacolour
#gtk-dark rubberband
find $SRC_DIR -type f -exec sed -i "s/$oldcolour1/$newcolour1/g" {} \;
#gtk rubberband
oldcolour1="129, 166, 91"
find $SRC_DIR -type f -exec sed -i "s/$oldcolour1/$newcolour1/g" {} \;
echo "Finished! Next, delete all assets i.e. png's with script number 2"