21 lines
369 B
Go
21 lines
369 B
Go
package main
|
|
|
|
import "github.com/fogleman/gg"
|
|
|
|
func main() {
|
|
dc := gg.NewContext(256, 256)
|
|
dc.SetRGBA(1, 0, 0, 0.3)
|
|
dc.Clear()
|
|
dc.MoveTo(20, 20)
|
|
dc.LineTo(236, 236)
|
|
dc.LineTo(236, 128)
|
|
dc.LineTo(20, 128)
|
|
dc.QuadraticTo(0, 64, 120, 20)
|
|
dc.SetRGBA(1, 0, 0, 0.8)
|
|
dc.FillPreserve()
|
|
dc.SetRGB(0, 0, 0)
|
|
dc.SetLineWidth(8)
|
|
dc.Stroke()
|
|
dc.WriteToPNG("out.png")
|
|
}
|