generativeart/example/example_maze.go

21 lines
394 B
Go
Raw Normal View History

package main
2021-03-02 03:23:29 +00:00
import (
2021-03-03 16:48:26 +00:00
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
2021-03-02 03:23:29 +00:00
"math/rand"
"time"
)
func main() {
2021-03-02 03:23:29 +00:00
rand.Seed(time.Now().Unix())
2021-03-04 02:46:41 +00:00
c := generativeart.NewCanva(600, 600)
c.SetBackground(common.Azure)
2021-03-03 09:38:34 +00:00
c.SetLineWidth(3)
c.SetLineColor(common.Orange)
2021-03-02 03:23:29 +00:00
c.FillBackground()
c.Draw(arts.NewMaze(20))
2021-03-02 03:23:29 +00:00
c.ToPNG("maze.png")
}