- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshadow.py
More file actions
Latest commit
25 lines (18 loc) · 521 Bytes
/
Copy pathshadow.py
File metadata and controls
25 lines (18 loc) · 521 Bytes
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
importpixie
image=pixie.Image(200, 200)
image.fill(pixie.Color(1, 1, 1, 1))
path=pixie.Path()
path.polygon(100, 100, 70, sides=8)
paint=pixie.Paint(pixie.SOLID_PAINT)
paint.color=pixie.Color(1, 1, 1, 1)
polygon_image=pixie.Image(200, 200)
polygon_image.fill_path(path, paint)
shadow=polygon_image.shadow(
offset=pixie.Vector2(2, 2),
spread=2,
blur=10,
color=pixie.Color(0, 0, 0, 0.78125)
)
image.draw(shadow)
image.draw(polygon_image)
image.write_file("examples/shadow.png")