avatarGen

package module
v0.0.0-...-b5ca997 Latest Latest
Warning

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

Go to latest
Published: May 17, 2016 License: MIT Imports: 14 Imported by: 0

README

go-avatar-gen

Generate Avatars for Users.

Usage

GenerateAvatar(input string, blockSize int, borderSize int

Use like this:


import (
  avatarGen "github.com/alternaDev/go-avatar-gen"
)

avatar := avatarGen.GenerateAvatar("HeinzPeda", 64, 32) // => *image.RGBA

You can then write this avatar to a HTTP Response like this:

import (
  avatarGen "github.com/alternaDev/go-avatar-gen"
)

avatar := avatarGen.GenerateAvatar("HeinzPeda", 64, 32) // => *image.RGBA
err := avatarGen.WriteImageToHTTP(respWriter, avatar)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAvatar

func GenerateAvatar(input string, blockSize int, borderSize int) *image.RGBA

GenerateAvatar generates an avatar (image.RGBA) using the given string as a random seed.

func HSVToRGB

func HSVToRGB(h float64, s float64, v float64) (float64, float64, float64)

func WriteImageToHTTP

func WriteImageToHTTP(w http.ResponseWriter, img image.Image) error

WriteImageToHTTP Sends an image via http.

Types

This section is empty.

Jump to

Keyboard shortcuts

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