decode

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(dst ivg.Destination, src []byte, opts ...DecodeOption) error

Decode decodes an IconVG graphic. If no option to change the color palette is provided, the palette suggested in the IconVG graphic's data will be used.

func DecodeViewBox

func DecodeViewBox(src []byte) (vb ivg.ViewBox, err error)

DecodeViewbox decodes only the metadata in an IconVG graphic.

func Disassemble added in v0.0.7

func Disassemble(src []byte) ([]byte, error)

Disassemble returns a disassembly of an encoded IconVG graphic.

Types

type DecodeError

type DecodeError string

func (DecodeError) Error

func (e DecodeError) Error() string

type DecodeOption

type DecodeOption func(*ivg.Metadata)

DecodeOption is an optional parameter to the Decode function.

func WithColorAt

func WithColorAt(index int, c color.Color) DecodeOption

WithColorAt replaces the color at the given index in the palette that was decoded.

func WithPalette

func WithPalette(p [64]color.RGBA) DecodeOption

WithPalette replaces the complete palette with the given one.

Jump to

Keyboard shortcuts

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