diff options
Diffstat (limited to 'tools/colorFixer.sh')
-rwxr-xr-x | tools/colorFixer.sh | 18 |
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 |