forked from Pythonity/font-awesome-to-png
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshadow.py
31 lines (27 loc) · 897 Bytes
/
shadow.py
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
from font_to_png import *
config = assets[FONT_AWESOME]
icons = load_icon_mapping(config)
size = 32
outter_size = 40
color = "#ffffff"
dummy_image = new_canvas_image(config, size)
OUTDIR = "gen-menu-shadow/"
if not path.exists(OUTDIR):
makedirs(OUTDIR)
name_map = {
"fire" : "hot",
"leaf" : "fresh",
"beaker" : "trending",
"off" : "logout",
"envelope" : "feedback",
"user" : "profile"
}
for icon in ["fire", "leaf", "beaker", "off", "user", "envelope"]:
filename = OUTDIR + "navdrawer_" + name_map[icon] + ".png"
print("Exporting icon \"%s\" as %s (%ix%i pixels)" %
(icon, filename, size, size))
img = get_icon_image(config, icons[icon], size, color, image=dummy_image,
outter_size=outter_size, shadow=True)
bg = Image.new("RGBA", (outter_size + 14, outter_size + 8), (0,0,0,0))
bg.paste(img, (0, 8))
bg.save(filename)