ginger-go

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 3 Imported by: 0

README

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.

Support image format

  • ✅ 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

  • One color Identicon 1 Identicon 2 Identicon 3 Identicon 4

  • Multi color Identicon 5 Identicon 6 Identicon 7 Identicon 8

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

Github Identicon 1 Github Identicon 2 Github Identicon  3 Github Identicon  4

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL