Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"math/rand"
"os"
svg "github.com/ajstarks/svgo"
)
var (
canvas = svg.New(os.Stdout)
width = 1000
height = 500
)
func main() {
canvas.Start(width, height)
canvas.Gstyle("fill:#22264b")
var color string
radius := 90
step := 8
for i := 0; i < 200; i++ {
if i%4 == 0 {
color = "#e6cf8b"
} else {
color = "#b56969"
}
x, y := rand.Intn(width), rand.Intn(height)
for r, nc := radius, 0; nc < 10; nc++ {
canvas.Circle(x, y, r, "stroke:"+color)
r -= step
}
}
canvas.Gend()
canvas.End()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment