aboutsummaryrefslogtreecommitdiff
path: root/tools/colorFixer.sh
diff options
context:
space:
mode:
authorLibravatar Daniel Ruiz de Alegría <daniruizdealegria@gmail.com>2018-03-15 16:20:52 +0100
committerLibravatar Daniel Ruiz de Alegría <daniruizdealegria@gmail.com>2018-03-15 16:20:52 +0100
commit4802449a64d78fca71c77cab8ca007c23ea9eb86 (patch)
treefe0b1c40e56a201795719aa8dc61d29093764119 /tools/colorFixer.sh
parent26bd2d765a05fc9ca94d7c7b22df82135ca50d0b (diff)
downloadflat-remix-4802449a64d78fca71c77cab8ca007c23ea9eb86.tar.gz
flat-remix-4802449a64d78fca71c77cab8ca007c23ea9eb86.zip
Finish colorFixer.sh
Diffstat (limited to 'tools/colorFixer.sh')
-rwxr-xr-xtools/colorFixer.sh18
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/colorFixer.sh b/tools/colorFixer.sh
index 96d15233a..427715f37 100755
--- a/tools/colorFixer.sh
+++ b/tools/colorFixer.sh
@@ -1,19 +1,8 @@
#!/bin/bash
-paletteColors=(
- 'rgb(0%,0%,0%)'
- 'rgb(100%,100%,100%)'
- 'rgb(97.647059%,87.058824%,41.176471%)'
- 'rgb(100%,78.431373%,19.215686%)'
- 'rgb(100%,78.431373%,19.215686%)'
- 'rgb(5.882353%,63.137255%,37.254902%)'
- 'rgb(10.588235%,63.921569%,53.72549%)'
- 'rgb(90.196078%,90.196078%,90.196078%)'
- 'rgb(27.058824%,27.058824%,27.058824%)'
- 'rgb(32.156863%,70.196078%,85.098039%)'
- 'rgb(21.176471%,48.235294%,94.117647%)'
- 'rgb(72.941176%,9.019608%,30.588235%)'
-)
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+paletteColors=($(cat "$DIR/paletteColors"))
function findNearestColor {
rgb1=($(grep -o -P '(\d+(.\d+)?)(?=%)' <<< $1))
@@ -45,6 +34,7 @@ function findNearestColor {
for file in $(find -maxdepth 1 -type f -printf "%f\n")
do
echo ===================================================
+ echo $file
svg=$(cat $file)
file_colors=$(grep -o -P 'rgb\((\d+(.\d+)?%,?){3}\)' $file)
for file_color in $file_colors