0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-21 16:04:02 +01:00
gitea/vendor/github.com/issue9/identicon
6543 57b6f83191
Update github.com/issue9/identicon from untagged to v1.0.1 (#11359)
Co-authored-by: zeripath <art27@cantab.net>
2020-05-10 06:23:17 -04:00
..
.gitignore Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
.travis.yml Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
block.go Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
doc.go Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
go.mod Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
go.sum Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
identicon.go Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
LICENSE Added all required dependencies 2016-11-04 08:43:11 +01:00
polygon.go Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00
README.md Update github.com/issue9/identicon from untagged to v1.0.1 (#11359) 2020-05-10 06:23:17 -04:00

identicon Build Status

根据用户的 IP 、邮箱名等任意数据为用户产生漂亮的随机头像。

screenhost.1 screenhost.4 screenhost.5 screenhost.6 screenhost.7

// 根据用户访问的IP为其生成一张头像
img, _ := identicon.Make(128, color.NRGBA{},color.NRGBA{}, []byte("192.168.1.1"))
fi, _ := os.Create("/tmp/u1.png")
png.Encode(fi, img)
fi.Close()

// 或者
ii, _ := identicon.New(128, color.NRGBA{}, color.NRGBA{}, color.NRGBA{}, color.NRGBA{})
img := ii.Make([]byte("192.168.1.1"))
img = ii.Make([]byte("192.168.1.2"))

安装

go get github.com/issue9/identicon

文档

Go Walker GoDoc

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。