-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c921e14
Showing
348 changed files
with
8,354 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
build/ | ||
.idea | ||
vendor | ||
glide.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Oleg Lobanov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
PLATFORMS := linux/amd64 windows/amd64/.exe windows/386/.exe darwin/amd64 | ||
|
||
temp = $(subst /, ,$@) | ||
os = $(word 1, $(temp)) | ||
arch = $(word 2, $(temp)) | ||
ext = $(word 3, $(temp)) | ||
VERSION := $(shell git describe --abbrev=0 --tags) | ||
|
||
.PHONY: build | ||
|
||
build: clean $(PLATFORMS); | ||
|
||
clean: | ||
rm -rf build/ | ||
|
||
assets: | ||
go-bindata -nomemcopy -pkg govatar data/... | ||
|
||
$(PLATFORMS): | ||
GOOS=$(os) GOARCH=$(arch) go build -ldflags "-X main.version=${VERSION}" -o 'build/govatar$(ext)' github.com/o1egl/govatar/govatar | ||
zip 'build/govatar-$(os)-$(arch).$(VERSION).zip' 'build/govatar$(ext)' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# GOvatar | ||
[![GoDoc](https://godoc.org/github.com/o1egl/govatar?status.svg)](https://godoc.org/github.com/o1egl/govatar) | ||
|
||
![GOvatar image](files/avatars.jpg) | ||
|
||
## Overview | ||
|
||
GOvatar is an avatar generator writen in GO | ||
|
||
## Install | ||
|
||
To install the library and command line program, use the following: | ||
|
||
``` | ||
$ go get -u github.com/o1egl/govatar/... | ||
``` | ||
|
||
[Binary packages](https://github.com/o1egl/govatar/releases) are available for Mac, Linux and Windows. | ||
|
||
## Usage | ||
|
||
```bash | ||
$ govatar generate male -o avatar.png # Generates random avatar.png for male | ||
$ govatar generate female -o avatar.png # Generates random avatar.png for female | ||
$ govatar -h # Display help message | ||
``` | ||
|
||
#### As lib | ||
|
||
Generates avatar and save it to file | ||
|
||
```go | ||
govatar.GenerateFile(govatar.MALE, "/path/to/file") | ||
```` | ||
|
||
Generates avatar and return it as image.Image | ||
|
||
```go | ||
img, err := govatar.Generate(govatar.MALE) | ||
```` | ||
## Copyright, License & Contributors | ||
### Adding new skins | ||
1. Add new skins to data/background, male/clothes, female/hair and etc... | ||
2. Run ``$ go-bindata -nomemcopy -pkg govatar data/...`` for building embedded assets. | ||
3. Submit pull request :) | ||
### Submitting a Pull Request | ||
1. Fork it. | ||
2. Create a branch (`git checkout -b my_branch`) | ||
3. Commit your changes (`git commit -am "Added new awesome avatars"`) | ||
4. Push to the branch (`git push origin my_branch`) | ||
5. Open a [Pull Request](https://github.com/o1egl/govatar/pulls) | ||
6. Enjoy a refreshing Diet Coke and wait | ||
GOvatar is released under the MIT license. See [LICENSE](LICENSE) |
Oops, something went wrong.