Documentation ¶
Index ¶
- Variables
- type Avatar
- func (a *Avatar) ConfigureColor(fontColor, backColor string) *Avatar
- func (a *Avatar) ConfigureFont(path string, size float64) *Avatar
- func (a *Avatar) ConfigurePosition(x, y int) *Avatar
- func (a *Avatar) ConfigureSize(width, height int) *Avatar
- func (a *Avatar) ToDisk(initials, path string) error
- func (a *Avatar) ToDiskCustom(initials, path, bgColor, fontColor string) error
- func (a *Avatar) ToHTTP(initials string, w http.ResponseWriter) error
- func (a *Avatar) ToHTTPCustom(initials, bgColor, fontColor string, w http.ResponseWriter) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Red = image.Uniform{color.RGBA{230, 25, 75, 255}} Green = image.Uniform{color.RGBA{60, 180, 75, 255}} Yellow = image.Uniform{color.RGBA{255, 225, 25, 255}} Blue = image.Uniform{color.RGBA{0, 130, 200, 255}} Orange = image.Uniform{color.RGBA{245, 130, 48, 255}} Purple = image.Uniform{color.RGBA{145, 30, 180, 255}} Cyan = image.Uniform{color.RGBA{70, 240, 240, 255}} Magenta = image.Uniform{color.RGBA{240, 50, 230, 255}} Lime = image.Uniform{color.RGBA{210, 245, 60, 255}} Pink = image.Uniform{color.RGBA{250, 190, 190, 255}} Teal = image.Uniform{color.RGBA{0, 128, 128, 255}} Lavender = image.Uniform{color.RGBA{230, 190, 255, 255}} Brown = image.Uniform{color.RGBA{170, 110, 40, 255}} Beige = image.Uniform{color.RGBA{255, 250, 200, 255}} Maroon = image.Uniform{color.RGBA{128, 0, 0, 255}} Mint = image.Uniform{color.RGBA{170, 255, 195, 255}} Olive = image.Uniform{color.RGBA{128, 128, 0, 255}} Coral = image.Uniform{color.RGBA{255, 215, 180, 255}} Grey = image.Uniform{color.RGBA{128, 128, 128, 255}} Gold = image.Uniform{color.RGBA{251, 184, 41, 255}} )
Colors for background
Functions ¶
This section is empty.
Types ¶
type Avatar ¶
type Avatar struct { FontPath string FontSize float64 Width int Height int Dpi int Spacer int TextX int TextY int FontColor string BackColor string }
func (*Avatar) ConfigureColor ¶
ConfigureColor configures font and background colors
func (*Avatar) ConfigureFont ¶
ConfigureFont configures font path and font size
func (*Avatar) ConfigurePosition ¶ added in v0.0.2
ConfigurePosition configures avatar symbols position
func (*Avatar) ConfigureSize ¶
ConfigureSize configures size of symbols
func (*Avatar) ToDiskCustom ¶
ToDiskCustom saves the image to disk
func (*Avatar) ToHTTP ¶
func (a *Avatar) ToHTTP(initials string, w http.ResponseWriter) error
ToHTTP sends the image to a http.ResponseWriter (as a PNG)
func (*Avatar) ToHTTPCustom ¶
func (a *Avatar) ToHTTPCustom(initials, bgColor, fontColor string, w http.ResponseWriter) error
ToHTTPCustom sends the image to a http.ResponseWriter (as a PNG)
Click to show internal directories.
Click to hide internal directories.