Documentation ¶
Index ¶
- Constants
- Variables
- func DropsBG(bg image.Uniform) *image.RGBA
- func FastBG(bg image.Uniform) *image.RGBA
- func GetBG(bg image.Uniform, method BGMethod) *image.RGBA
- func GetDefaultBG(bg image.Uniform) *image.RGBA
- func HexToColor(hexColor string) (color.Color, error)
- func LinenLikeBG(bg image.Uniform) *image.RGBA
- func LoadGPL(fs http.FileSystem, fname string) (color.Palette, error)
- func LoadHex(fs fs.FS, fname string) (color.Palette, error)
- func SetDefaultBGType(bgtype BGMethod)
- func ToDisk(initials, path string)
- func ToDiskCustom(initials, path, bgColor, fontColor string)
- func ToHTTP(initials string, w http.ResponseWriter)
- func ToHTTPCustom(initials, bgColor, fontColor string, w http.ResponseWriter)
- func ToSlice(initials string, colorSalt int) ([]byte, error)
- func ToSliceCustomColors(initials string, bgColor, fontColor string) ([]byte, error)
- type BGMethod
Constants ¶
View Source
const ( LettersCap = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" Threshold = 130000 )
Variables ¶
View Source
var ( White = image.Uniform{color.RGBA{255, 255, 255, 255}} Black = image.Uniform{color.RGBA{0, 0, 0, 255}} )
Colors for background
Functions ¶
func SetDefaultBGType ¶
func SetDefaultBGType(bgtype BGMethod)
func ToDiskCustom ¶
func ToDiskCustom(initials, path, bgColor, fontColor string)
ToDiskCustom saves the image to disk
func ToHTTP ¶
func ToHTTP(initials string, w http.ResponseWriter)
ToHTTP sends the image to a http.ResponseWriter (as a PNG)
func ToHTTPCustom ¶
func ToHTTPCustom(initials, bgColor, fontColor string, w http.ResponseWriter)
ToHTTPCustom sends the image to a http.ResponseWriter (as a PNG)
Types ¶
Click to show internal directories.
Click to hide internal directories.