helpers

package module
v0.0.0-...-9559227 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2020 License: Unlicense Imports: 15 Imported by: 1

README

helpers

Gio helpers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawRectangle

func DrawRectangle(gtx *layout.Context, w, h int, color color.RGBA, borderRadius [4]float32, inset unit.Value)

func HexARGB

func HexARGB(s string) (c color.RGBA)

func LoadSvgFile

func LoadSvgFile(svgData []byte, outSize float32) []byte

Types

type Circle

type Circle struct {
	Cx float32 `xml:"cx,attr"`
	Cy float32 `xml:"cy,attr"`
	R  float32 `xml:"r,attr"`
}

type Path

type Path struct {
	D           string   `xml:"d,attr"`
	Fill        string   `xml:"fill,attr"`
	FillOpacity *float32 `xml:"fill-opacity,attr"`
	Opacity     *float32 `xml:"opacity,attr"`
	// contains filtered or unexported fields
}

type SVG

type SVG struct {
	Width   string  `xml:"width,attr"`
	Height  string  `xml:"height,attr"`
	Fill    string  `xml:"fill,attr"`
	ViewBox string  `xml:"viewBox,attr"`
	Paths   []*Path `xml:"path"`
	// Some of the SVG files contain <circle> elements, not just <path>
	// elements. IconVG doesn't have circles per se. Instead, we convert such
	// circles to paired arcTo commands, tacked on to the first path.
	//
	// In general, this isn't correct if the circles and the path overlap, but
	// that doesn't happen in the specific case of the Material Design icons.
	Circles []Circle `xml:"circle"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL