Documentation ¶
Overview ¶
Package identicon helps generating deterministic user identicons
Index ¶
- func MD5(text string) []byte
- func RGB(r, g, b uint8) color.NRGBA
- type Identicon
- func (ic *Identicon) At(x, y int) color.Color
- func (ic *Identicon) Bounds() image.Rectangle
- func (ic *Identicon) ColorModel() color.Model
- func (ic *Identicon) HashString() string
- func (ic *Identicon) NRGBAAt(x, y int) color.NRGBA
- func (ic *Identicon) PixOffset(x, y int) int
- func (ic *Identicon) Set(x, y int, c color.Color)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Identicon ¶
type Identicon struct { Color color.Color Hash []byte ID string Options *Options Tiles [][]bool // Pix holds the image's pixels, in R, G, B, A order. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
Identicon defines an identicon
func (*Identicon) At ¶
At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
func (*Identicon) ColorModel ¶
ColorModel returns the Image's color model.
func (*Identicon) HashString ¶
HashString returns hash value as string
Click to show internal directories.
Click to hide internal directories.