Categorygithub.com/go-mods/avatar
repositorypackage
0.0.0-20240904200805-3803a50c51e4
Repository: https://github.com/go-mods/avatar.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

avatar

GoDoc Go Report Card License

Avatar is a Go package that generates avatar from name.

Circle avatar

Square avatar

Custom avatar

Color palette from initial

Avatar server

Use docker to run the server:

docker build -t avatar-server .
docker run -t --rm -v ./assets:/avatar/assets -p 8080:8080 -d --name avatar-server avatar-server

or use docker-compose:

docker-compose build
docker-compose up -d

Generate an avatar

http://localhost:8080/api?name=John%20Doe
http://localhost:8080/api?name=John%20Doe&shape=square&width=200&height=200&backgroundColor=red&fontColor=white&fontFamily=Caprasimo&fontWeight=400&borderWidth=10&borderColor=blue&borderDash=10,10&borderRadius=50&padding=5

Options (query params) to use to customize the avatar initial

query parametertype
namestring
separatorstring
sensitivestring
lowercaseboolean
uppercaseboolean
camelcaseboolean
lengthnumber
wordLengthboolean

Options (query params) to use to customize the avatar

query parametertype
widthnumber
heightnumber
backgroundColorstring
fontFamilystring
fontWeightstring
fontSizenumber
fontColorstring
shapestring (circle, square)
borderDashstring (css border dash)
borderWidthnumber
borderRadiusnumber
borderColorstring
paddingnumber
randomFontColorboolean
randomBorderColorboolean