Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.42 KB

README.md

File metadata and controls

65 lines (43 loc) · 1.42 KB

Build

Identigo generates always the same image when given the same string.
That way, we'll be able to generate a beautiful gradient to be used as a temporary avatar for Hackdoor users.

Usage

Installation via Go Modules is encouraged:

go get github.com/Hackdoor-io/identigo

You can now use Identigo as follows:

package main

import identigo "github.com/Hackdoor-io/identigo"

func main() {
  str := "gopher"
  img := identigo.GenerateFromString(str, 256, 256)

  file, _ := os.Create(str + ".png")
  png.Encode(file, img)
}

where GenerateFromString accepts the following arguments:

Argument Type Example
text string "gopher"
width int 256
height int 256

this code generates the following image:

Examples

identigo.GenerateFromString("ada_lovelace", 256, 256)

identigo.GenerateFromString("alonzo_church", 256, 256)

identigo.GenerateFromString("johndoe", 256, 256)

License

GPLv3