Skip to content

Commit

Permalink
Update README.md (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
princemaple authored Mar 4, 2021
1 parent 97df944 commit a3044b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@ Prebuilt [binary packages](https://github.com/o1egl/govatar/releases) are availa
## 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 generate male -u [email protected] -o avatar.png # Generates avatar.png for specified username
$ govatar -h # Display help message
$ 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 generate male -u [email protected] -o avatar.png # Generates avatar.png for specified username
$ govatar -h # Display help message
```

#### As lib

Generates avatar and save it to filePath

```go
err := govatar.GenerateFile(govatar.MALE, "/path/to/avatar.jpg"
err := govatar.GenerateFileFromUsername(govatar.MALE, "username", "/path/to/avatar.jpg")
err := govatar.GenerateFile(govatar.MALE, "/path/to/avatar.jpg")
err := govatar.GenerateFileFromUsername(govatar.MALE, "username", "/path/to/avatar.jpg")
````

Generates an avatar and returns it as an image.Image

```go
img, err := govatar.Generate(govatar.MALE)
img, err := govatar.GenerateForUsername(govatar.MALE, "username")
img, err := govatar.Generate(govatar.MALE)
img, err := govatar.GenerateForUsername(govatar.MALE, "username")
````
Expand Down

0 comments on commit a3044b1

Please sign in to comment.