Skip to content

Instantly share code, notes, and snippets.

@khayyamsaleem
Created August 18, 2022 21:17
Show Gist options
  • Save khayyamsaleem/4a5f87613eb58e4c557343b129097e3d to your computer and use it in GitHub Desktop.
Save khayyamsaleem/4a5f87613eb58e4c557343b129097e3d to your computer and use it in GitHub Desktop.
creating a grid with svgo
package main
import (
"github.com/ajstarks/svgo"
"os"
)
func main() {
width := 500
height := 500
canvas := svg.New(os.Stdout)
canvas.Start(width, height)
canvas.Circle(width/2, height/2, 100)
canvas.Text(width/2, height/2, "Hello, SVG", "text-anchor:middle;font-size:30px;fill:white")
canvas.Grid(0, 0, width, height, 16, "stroke:gray; opacity:1")
canvas.End()
}
@khayyamsaleem
Copy link
Author

the key was stroke and opacity, i suppose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment