generativeart/example/example_janus.go

21 lines
420 B
Go
Raw Permalink Normal View History

2021-03-05 10:08:15 +00:00
package main
import (
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
2021-03-05 10:08:15 +00:00
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(500, 500)
c.SetBackground(common.Black)
2021-03-05 10:08:15 +00:00
c.FillBackground()
c.SetColorSchema(common.DarkRed)
c.SetForeground(common.LightPink)
c.Draw(arts.NewJanus(10, 0.2))
2021-03-05 10:08:15 +00:00
c.ToPNG("janus.png")
}