generativeart/example/example_solarflare.go

21 lines
414 B
Go
Raw Normal View History

2021-03-15 10:53:45 +00:00
package main
import (
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
2021-03-15 10:53:45 +00:00
"github.com/jdxyw/generativeart/common"
"image/color"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(500, 500)
c.SetBackground(common.Black)
c.FillBackground()
c.SetLineColor(color.RGBA{255, 64, 8, 128})
c.Draw(arts.NewSolarFlare())
2021-03-15 10:53:45 +00:00
c.ToPNG("solarflare.png")
}