pixie/examples/shadow.nim
2021-02-19 12:06:16 -06:00

25 lines
414 B
Nim

import pixie
let image = newImage(200, 200)
image.fill(rgba(255, 255, 255, 255))
let polygonImage = newImage(200, 200)
polygonImage.fillPolygon(
vec2(100, 100),
70,
sides = 8,
rgba(255, 255, 255, 255)
)
let shadow = polygonImage.shadow(
offset = vec2(2, 2),
spread = 2,
blur = 10,
color = rgba(0, 0, 0, 200)
)
image.draw(shadow)
image.draw(polygonImage)
image.writeFile("examples/shadow.png")