package svg

import "fyne.io/fyne/v2/internal/svg"

Index

Functions

func Colorize

func Colorize(src []byte, clr color.Color) []byte

Colorize creates a new SVG from a given one by replacing all fill colors by the given color.

func ToImage

func ToImage(file io.Reader, width, height int, validateSize func(origW, origH int) bool) (*image.NRGBA, error)

ToImage reads an SVG from an io.Reader and renders it into an image.NRGBA using the requested width and height. The optional `validateSize` callback can be used to cancel the rendering depending on the SVG’s original size. In this case `nil` is returned.

Source Files

svg.go

Version
v2.2.2-rc3
Published
Jun 27, 2022
Platform
darwin/amd64
Imports
14 packages
Last checked
27 minutes ago

Tools for package owners.