generativeart/example/example_spiralsquare.go

23 lines
497 B
Go
Raw Normal View History

2021-03-03 05:07:40 +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-03 05:07:40 +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.MistyRose)
2021-03-03 05:07:40 +00:00
c.SetLineWidth(10)
c.SetLineColor(common.Orange)
c.SetColorSchema(common.Plasma)
c.SetForeground(common.Tomato)
2021-03-03 05:07:40 +00:00
c.FillBackground()
c.Draw(arts.NewSpiralSquare(40, 400, 0.05, true))
2021-03-03 05:07:40 +00:00
c.ToPNG("spiralsquare.png")
}