generativeart/example/example_blackhole.go
2021-03-19 14:23:42 +08:00

22 lines
460 B
Go

package main
import (
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
"image/color"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(500, 500)
c.SetBackground(color.RGBA{R: 30, G: 30, B: 30, A: 255})
c.FillBackground()
c.SetLineWidth(1.0)
c.SetLineColor(common.Tomato)
c.Draw(arts.NewBlackHole(200, 400, 0.01))
c.ToPNG("blackhole.png")
}