letteravatar

package module
v0.0.0-...-553181e Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: Apache-2.0, MIT Imports: 15 Imported by: 9

README

letteravatar

Forked from https://github.com/disintegration/letteravatar to stuff that I need :)

Documentation

Overview

Package letteravatar generates letter-avatars.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(size int, letters string, options *Options) (image.Image, error)

Draw generates a new letter-avatar image of the given size using the given letter with the given options. Default parameters are used if a nil *Options is passed.

func Extract

func Extract(name string) string

Extract two letters from given name

Types

type Options

type Options struct {
	Font        *truetype.Font
	Palette     []color.Color
	LetterColor color.Color

	// PaletteKey is used to pick the background color from the Palette.
	// Using the same PaletteKey leads to the same background color being picked.
	// If PaletteKey is empty (default) the background color is picked randomly.
	PaletteKey string
}

Options are letter-avatar parameters.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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