avatar

package
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: 5 Imported by: 0

README

identicon

Github flavour Identicon implementation

Documentation

Overview

Package avatar implements a 5x5 block avatar image creation.

Example Usage

import "github.com/gitzart/identicon/avatar"

a := new(avatar.Avatar)
a.Text = "sometext"
m, _ := a.Create()

The output is "image.Image" type.

Further image processing can be done by using the helper functions provided in "github.com/gitzart/identicon" package.

Index

Constants

This section is empty.

Variables

View Source
var DefaultBG = color.NRGBA{0xed, 0xed, 0xed, 0xff}

DefaultBG is the default image background color.

Functions

This section is empty.

Types

type Avatar

type Avatar struct {
	// Case insensitive text
	Text string

	// Non-zero positive image size
	Size int

	// The value is in percentage. Ranges from 0 to 10.
	// Off limits values will be clipped.
	Padding int

	// Customizable avatar colors
	BGColor color.NRGBA
	Color   color.NRGBA
	// contains filtered or unexported fields
}

Avatar defines the properties to make an avatar image.

func (*Avatar) Create

func (a *Avatar) Create() (image.Image, error)

Create performs the algorithm to make an avatar image.

Jump to

Keyboard shortcuts

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