geometric-avatar
geometric-avatar
is a Go package that effortlessly generates captivating geometric pattern avatars based on email hashes.
Changelog | العربية
Features
- ✅ Simplicity & Ease: Straightforward and effortless to use.
- 🎨 Customizable: Tailor avatars to your preference with a range of customization options.
- 🆙 Golang v1.27 Compatibility: Developed and optimized for Golang version 1.27.
Installation
To integrate the package, utilize go get
:
go get github.com/nawafinity/geometric-avatar
Usage
Below is an illustrative example of how to utilize the package in your code.
package main
import (
"fmt"
"github.com/nawafinity/geometric-avatar"
"image/color"
)
func main() {
email := "geometric-avatar"
options := map[string]interface{}{
"size": 128.0,
"margin": 0.08,
"background": color.RGBA{238, 238, 238, 255},
}
avatar := geometric_avatar.GenerateAvatar(email, options)
dc := avatar.Render()
err := dc.SavePNG("output.png")
if err != nil {
fmt.Println("Error:", err)
}
}
Bugs and Feature Requests
Discovered a bug or have a feature request? Please open a new issue
License
MIT License