generativeart/example/example_dotline.go

23 lines
480 B
Go
Raw Normal View History

2021-03-04 04:06:45 +00:00
package main
import (
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
2021-03-04 04:06:45 +00:00
"image/color"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(2080, 2080)
c.SetBackground(color.RGBA{230, 230, 230, 255})
c.SetLineWidth(10)
2021-03-04 05:59:46 +00:00
c.SetIterations(15000)
2021-10-22 12:58:44 +00:00
c.SetColorSchema(common.DarkPink)
2021-03-04 04:06:45 +00:00
c.FillBackground()
c.Draw(arts.NewDotLine(100, 20, 50, false))
2021-03-04 04:06:45 +00:00
c.ToPNG("dotline.png")
}