identigo

command module
v0.0.0-...-8a05f3e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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