add play.golang.org link
initial import
Egon Elbre's logo for Gio in SVG and IconVG format.
import "eliasnaur.com/giologo"
import "golang.org/x/exp/shiny/iconvg"
sz := 100 // pixels
logo := giologo.Gio
m, _ := iconvg.DecodeMetadata(logo)
dx, dy := m.ViewBox.AspectRatio()
img := image.NewRGBA(image.Rectangle{Max: image.Point{X: sz, Y: int(float32(sz) * dy / dx)}})
var ico iconvg.Rasterizer
ico.SetDstImage(img, img.Bounds(), draw.Src)
// Use white for icons.
m.Palette[0] = color.RGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff}
iconvg.Decode(&ico, logo, &iconvg.DecodeOptions{
Palette: &m.Palette,
})
See the result here.