identicon

package module
v0.0.0-...-1c845dd Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 7 Imported by: 0

README

identicon

Github flavour Identicon implementation

Documentation

Overview

Package identicon implements identicon creation.

This specific file does not contain the identicon implementions. It only provides some helper functions to smooth the identicon creation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeBase64

func EncodeBase64(data []byte) string

EncodeBase64 performs base64 formatting for HTML base64 image tag.

func EncodeJPEG

func EncodeJPEG(m image.Image, quality int) ([]byte, error)

EncodeJPEG performs the JPEG formatting.

func EncodePNG

func EncodePNG(m image.Image) ([]byte, error)

EncodePNG performs the PNG formatting with the BestCompression setting.

func Must

func Must(m image.Image, err error) image.Image

Must panics on identicon creation error. Must is a convenience wrapper that panics when passed a non-nil error value

func NewAvatar

func NewAvatar(text string, size, padding int) *avatar.Avatar

NewAvatar returns a new pointer avatar.

func SaveToFile

func SaveToFile(filename string, data []byte) error

SaveToFile writes the image to a file.

Types

type Identicon

type Identicon interface {
	Create() (image.Image, error)
}

Identicon represents an avatar.

Directories

Path Synopsis
Package avatar implements a 5x5 block avatar image creation.
Package avatar implements a 5x5 block avatar image creation.
Quick and dirty command line identicon generator.
Quick and dirty command line identicon generator.

Jump to

Keyboard shortcuts

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