avatars

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 8 Imported by: 0

README

go-avatars

Go library for avatar generation.

Based on @dicebear

Supports SVG and PNG output.

Sample generated by main.go

sample

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PNG

func PNG(name string, opts ...Option) ([]byte, error)

PNG generates an PNG avatar using the given name as seed.

func SVG

func SVG(name string, opts ...Option) ([]byte, error)

SVG generates an SVG avatar using the given name as seed.

Types

type Option added in v0.2.0

type Option interface {
	// contains filtered or unexported methods
}

Option is a function that applies an option to the avatar service.

type Options added in v0.2.0

type Options struct {
	// Size of the rendered avatar.
	Size int
	// Padding between the rendered avatar and the border.
	Padding int
}

Options for the avatar service.

type Padding added in v0.2.0

type Padding int

Padding sets the padding between the rendered avatar and the border.

type RenderSize added in v0.2.0

type RenderSize int

RenderSize sets the size of the rendered avatar in pixels.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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