Skip to content

Instantly share code, notes, and snippets.

@icub3d
Forked from anonymous/colorize.sh
Last active August 29, 2015 13:57
Show Gist options
  • Save icub3d/9668727 to your computer and use it in GitHub Desktop.
Save icub3d/9668727 to your computer and use it in GitHub Desktop.
Automatically change the colors of glyphicons.
#!/bin/bash
while read NAME HEX; do
for i in `find -name "*-white.svg"`; do
FILENAME=`echo $i | sed -e "s/white/$NAME/g"`
sed -e "s/#FFFFFF/$HEX/g" $i >$FILENAME
PNG=`echo $FILENAME | sed -e "s/svg/png/g"`
convert $FILENAME -transparent white $PNG
done
for i in "" "filetypes" "halflings" "social"; do
WHERE="_$i"
if [[ "$i" = "" ]]; then
WHERE=""
fi
CSS="$i"
if [[ "$CSS" = "" ]]; then
CSS="glyphicons"
fi
FILENAME="./glyphicons$WHERE/web/html_css/css/$NAME.css"
echo ".$CSS.$NAME:before {
color: $HEX;
}
.$CSS-icon.$NAME {
background-image: url(../images/glyphicons$WHERE-$NAME.svg);
}
.$CSS-icon.$NAME _:-o-prefocus,
.$CSS-icon.$NAME {
background-image: url(../images/glyphicons$WHERE-$NAME.png);
}
.no-inlinesvg .$CSS-icon.$NAME {
background-image: url(../images/glyphicons$WHERE-$NAME.png);
}" > $FILENAME
done
done < colors
green #006600
dark-blue #375EAB
pale-blue #E0EBF5
pale-yellow #FFFFD8
maroon #933
orange #FF9632
cd glyphicons_pro
./colorize.sh
find -name "*.css" | fgrep -v -e MACOSX -e style.css | xargs cat >all.css
cp all.css ~/my/project/css
for i in `find -name "*.svg" -or -name "*.png" | grep html_css`; do
cp $i ~/my/project/images/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment