Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert Maki Icons to PNG in different colors
#!/bin/bash
# LICENSE:
# Copyright © 2017 Ekaitz Zárraga <ekaitz.zarraga@protonmail.com>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the COPYING file for more details.
# Convert certain icons from Mapbox Maki icons to PNGs in different colors
# Uses: svgexport
# https://github.com/shakiba/svgexport
files="
dam-15.svg
mountain-15.svg
airfield-15.svg
airport-15.svg
heliport-15.svg
harbor-15.svg
industry-15.svg
ranger-station-15.svg
fuel-15.svg
embassy-15.svg
castle-15.svg
fence-15.svg
city-15.svg"
colors="
red
blue
green
black
white
yellow
orange
purple
crimson
grey
lime
cyan
"
for color in $colors; do
for f in $files; do
svgexport $f "${f%%-15.svg}-${color}.png" output size 30:30 styles "svg{fill: ${color}}"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment