~ols/yeet

237e694ab807109ced469146c27fe7ff6fca94f8 — Oliver Leaver-Smith 2 years ago 8947d93
change avatar method
1 files changed, 8 insertions(+), 1 deletions(-)

M avatar.go
M avatar.go => avatar.go +8 -1
@@ 31,6 31,7 @@ import (

	"github.com/gorilla/mux"
	adorable "github.com/ipsn/go-adorable"
	"github.com/aofei/cameron"
)

var avatarcolors = [4][4]byte{


@@ 68,12 69,18 @@ func loadAvatarColors() {
	}
}

func genAvatar(name string) []byte {
func genAvatara(name string) []byte {
	scheme := color.RGBA{R: 254, G: 246, B: 228, A: 255}
	img := adorable.PseudoRandomWithColor([]byte(name), scheme)
	return img
}

func genAvatar(name string) []byte {
	img := bytes.Buffer{}
	png.Encode(&img, cameron.Identicon([]byte(name), 540, 60))
	return img.Bytes()
}

func oldgenAvatar(name string) []byte {
	h := sha512.New()
	h.Write([]byte(name))