2021-03-03 05:07:40 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-03-03 16:48:26 +00:00
|
|
|
"github.com/jdxyw/generativeart"
|
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)
|
2021-03-03 05:07:40 +00:00
|
|
|
c.SetBackground(generativeart.MistyRose)
|
|
|
|
c.SetLineWidth(10)
|
|
|
|
c.SetLineColor(generativeart.Orange)
|
|
|
|
c.SetColorSchema(generativeart.Plasma)
|
|
|
|
c.SetForeground(generativeart.Tomato)
|
|
|
|
c.FillBackground()
|
|
|
|
c.Draw(generativeart.NewSpiralSquare(40, 400, 0.05, true))
|
|
|
|
c.ToPNG("spiralsquare.png")
|
|
|
|
}
|