Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Latest commit

 

History

History
68 lines (57 loc) · 2.27 KB

README.md

File metadata and controls

68 lines (57 loc) · 2.27 KB

identicon

identicon is a github's Identicons clone in Go

Simple example

Type: Horizontal, Theme: White (Default)

package main

import "github.com/1l0/identicon"

func main() {
	id := identicon.New()
	id.GeneratePNGToFile("identicons/default")

Type: Vertical, Theme: Black

	id.Type = identicon.Mirrorv
	id.Theme = identicon.Black
	id.GeneratePNGToFile("identicons/vertical_black")

Divisions: 7, Theme: Gray

	id.Type = identicon.Mirrorh
	id.Theme = identicon.Gray
	id.Q = 50
	id.Div = 7
	id.GeneratePNGToFile("identicons/div7_gray")

Margin: 140, Theme: Free

	id.Theme = identicon.Free
	id.Q = 70
	id.Div = 5
	id.Margin = 140
	id.GeneratePNGToFile("identicons/margin140_free")

Type: Normal, Theme: White

	id.Type = identicon.Normal
	id.Theme = identicon.White
	id.Margin = 35
	id.GeneratePNGToFile("identicons/normal_white")

Random batch

	id = identicon.New()
	id.GenerateRandomThemes("identicons/rand", 4)

Sequential batch

	id.GenerateSequentialThemes("identicons/seq", 1)
}