Ginger
Giner is simple identicon gengerator
This project is inspired by Github Indenticon, but the current implement is inspired from Don Park: 9-block IP Identification.
- ✅ PNG
- ✅ JPG
- ✏️ SVG (planning)
Support Identicon Style
- ✅ Don Park: 9-block IP Identification style
- ✅ Github Identicon style
- ✏️ Jdenticon style, multi-color (planning)
Installation
go get github.com/HungTP-Play/ginger-go@0.1.2
Usage
Don Park Style
import (
"log"
"github.com/HungTP-Play/ginger-go/constant"
"github.com/HungTP-Play/ginger-go/ginger"
)
func main() {
info := "Tom_Ford_Black_Orchid"
outputDir := "output"
imageSize := 500
padding := float64(imageSize) * 0.05
multiColor := true
_, err := ginger.DrawIdenticon(info, outputDir, imageSize, int(padding), constant.JPG, multiColor)
if err != nil {
log.Printf(err.Error())
}
}
Output Example
Github Style
import (
"log"
"github.com/HungTP-Play/ginger-go/constant"
"github.com/HungTP-Play/ginger-go/ginger"
)
func main() {
info := "Tom_Ford_Black_Orchid"
outputDir := "output"
imageSize := 500
padding := float64(imageSize) * 0.05
_, err := ginger.DrawGithubIdenticon(info, outputDir, imageSize, int(padding), constant.JPG)
if err != nil {
log.Printf(err.Error())
}
}
Output example