pixie/examples/square.nim

16 lines
270 B
Nim
Raw Normal View History

2020-12-01 17:49:41 +00:00
import pixie, chroma
2020-12-04 16:32:03 +00:00
var image = newImage(200, 200)
image.fill(rgba(255, 255, 255, 255))
2020-12-01 17:49:41 +00:00
2021-01-29 20:17:24 +00:00
var p: Path
2020-12-01 17:49:41 +00:00
p.moveTo(50, 50)
p.lineTo(50, 150)
p.lineTo(150, 150)
p.lineTo(150, 50)
p.closePath()
2021-01-29 20:17:24 +00:00
2020-12-01 17:49:41 +00:00
image.fillPath(p, rgba(255, 0, 0, 255))
image.writeFile("examples/square.png")