generativeart/example/example_randcircle.go

29 lines
545 B
Go

package main
import (
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
"image/color"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(500, 500)
c.SetBackground(common.MistyRose)
c.SetLineWidth(1.0)
c.SetLineColor(color.RGBA{
R: 122,
G: 122,
B: 122,
A: 30,
})
c.SetColorSchema(common.Plasma)
c.SetIterations(4)
c.FillBackground()
c.Draw(arts.NewRandCicle(30, 80, 0.2, 2, 10, 30, true))
c.ToPNG("randcircle.png")
}