generativeart/example/example_silksmoke.go

24 lines
513 B
Go
Raw Normal View History

2021-03-02 09:11:26 +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 09:11:26 +00:00
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
2021-03-04 02:46:41 +00:00
c := generativeart.NewCanva(500, 500)
c.SetBackground(common.Black)
2021-03-02 09:11:26 +00:00
c.SetLineWidth(1.0)
c.SetLineColor(common.MediumAquamarine)
2021-03-03 09:38:34 +00:00
c.SetAlpha(30)
c.SetColorSchema(common.Plasma)
2021-03-02 09:11:26 +00:00
c.SetIterations(4)
c.FillBackground()
c.Draw(arts.NewSilkSmoke(400, 20, 0.2, 2, 10, 30, false))
2021-03-02 09:11:26 +00:00
c.ToPNG("silksmoke.png")
}