generativeart/example/example_gridsquare.go

17 lines
333 B
Go
Raw Normal View History

2021-03-02 03:23:29 +00:00
package main
import (
2021-03-03 16:48:26 +00:00
"github.com/jdxyw/generativeart"
2021-03-02 03:23:29 +00:00
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(600, 600, 1, 1)
2021-03-03 09:38:34 +00:00
c.SetBackground(generativeart.DarkPink[rand.Intn(5)])
c.SetColorSchema(generativeart.DarkPink)
2021-03-02 03:23:29 +00:00
c.Draw(generativeart.NewGirdSquares())
c.ToPNG("gsquare.png")
}