2021-03-02 08:29:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-03-03 16:48:26 +00:00
|
|
|
"github.com/jdxyw/generativeart"
|
2021-03-16 04:04:05 +00:00
|
|
|
"github.com/jdxyw/generativeart/arts"
|
2021-03-11 09:35:03 +00:00
|
|
|
"github.com/jdxyw/generativeart/common"
|
2021-03-02 08:29:47 +00:00
|
|
|
"image/color"
|
|
|
|
"math/rand"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
rand.Seed(time.Now().Unix())
|
2021-03-04 02:46:41 +00:00
|
|
|
c := generativeart.NewCanva(500, 500)
|
2021-03-11 09:35:03 +00:00
|
|
|
c.SetBackground(common.MistyRose)
|
2021-03-02 08:29:47 +00:00
|
|
|
c.SetLineWidth(1.0)
|
|
|
|
c.SetLineColor(color.RGBA{
|
|
|
|
R: 122,
|
|
|
|
G: 122,
|
|
|
|
B: 122,
|
|
|
|
A: 30,
|
|
|
|
})
|
2021-03-11 09:35:03 +00:00
|
|
|
c.SetColorSchema(common.Plasma)
|
2021-03-02 08:29:47 +00:00
|
|
|
c.SetIterations(4)
|
|
|
|
c.FillBackground()
|
2021-03-16 04:04:05 +00:00
|
|
|
c.Draw(arts.NewRandCicle(30, 80, 0.2, 2, 10, 30, true))
|
2021-03-02 08:29:47 +00:00
|
|
|
c.ToPNG("randcircle.png")
|
|
|
|
}
|