generativeart/example/example_gridsquare.go

19 lines
395 B
Go
Raw Permalink 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"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
2021-03-02 03:23:29 +00:00
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
2021-03-04 02:46:41 +00:00
c := generativeart.NewCanva(600, 600)
c.SetBackground(common.DarkPink[rand.Intn(5)])
c.SetColorSchema(common.DarkPink)
c.Draw(arts.NewGirdSquares(24, 10, 0.2))
2021-03-02 03:23:29 +00:00
c.ToPNG("gsquare.png")
}