1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 01:54:26 +00:00
gitea/vendor/github.com/issue9/identicon/README.md
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

42 lines
1.4 KiB
Markdown
Vendored
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

identicon
[![Build Status](https://travis-ci.org/issue9/identicon.svg?branch=master)](https://travis-ci.org/issue9/identicon)
======
根据用户的 IP 、邮箱名等任意数据为用户产生漂亮的随机头像。
![screenhost.1](https://raw.github.com/issue9/identicon/master/screenshot/1.png)
![screenhost.4](https://raw.github.com/issue9/identicon/master/screenshot/4.png)
![screenhost.5](https://raw.github.com/issue9/identicon/master/screenshot/5.png)
![screenhost.6](https://raw.github.com/issue9/identicon/master/screenshot/6.png)
![screenhost.7](https://raw.github.com/issue9/identicon/master/screenshot/7.png)
```go
// 根据用户访问的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"))
```
### 安装
```shell
go get github.com/issue9/identicon
```
### 文档
[![Go Walker](https://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/issue9/identicon)
[![GoDoc](https://godoc.org/github.com/issue9/identicon?status.svg)](https://godoc.org/github.com/issue9/identicon)
### 版权
本项目采用 [MIT](https://opensource.org/licenses/MIT) 开源授权许可证,完整的授权说明可在 [LICENSE](LICENSE) 文件中找到。