Documentation
¶
Overview ¶
Package avatar is reponsible for creating avatar images Thanks to https://github.com/taironas/tinygraphs
Package avatar is reponsible for creating avatar images Thanks to https://github.com/taironas/tinygraphs
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoSuchScheme gets returned when there is no such color scheme ErrNoSuchScheme = errors.New("No such scheme") )
View Source
var Pallete = map[string][]color.RGBA{
"blue": {
{3, 63, 99, 255},
{40, 102, 110, 255},
{80, 197, 183, 255},
{255, 251, 255, 255},
},
"orange": {
{250, 121, 33, 255},
{254, 153, 32, 255},
{252, 252, 98, 255},
{255, 251, 255, 255},
},
"green": {
{0, 127, 95, 255},
{43, 147, 72, 255},
{85, 166, 48, 255},
{255, 251, 255, 255},
},
}
Functions ¶
func Palette ¶
Palette returns a color palette with the provided 'paletteName'
Types ¶
type Avatar ¶
type Avatar struct { Width int Height int Size string Data string RawData string Image *image.RGBA ImageBuffer *bytes.Buffer }
Avatar represents an avatar image
func (*Avatar) Encode ¶
Encode encodes the generated image as a JPEG image and writes it to ImageBuffer
func (*Avatar) Generate ¶
Generate will generate an avatar, encode and save it
func (*Avatar) GenerateImage ¶
GenerateImage generates a new 6 x 6 quadrant avatar based on the data (hashed by MD5) and specified color palette
Click to show internal directories.
Click to hide internal directories.