aag

animal-avatar-generator

Animal avatar generator

Showing:

Popularity

Downloads/wk

71

GitHub Stars

10

Maintenance

Last Commit

2mos ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

Animal Avatar Generator

Generate SVG avatars on client side from a string seed. As long as the same version of the library is used it always returns the same avatar for the corresponding seed.

Live example

Install

Using npm:

$ npm install animal-avatar-generator --save

or using yarn:

$ yarn add animal-avatar-generator

Usage

import avatar from 'animal-avatar-generator'

const svg = avatar('your custom seed', { size: 200 })
document.getElementById('avatar').innerHTML = svg

Configuration options

NameTypeDescriptionDefault
sizenumberAvatar size in pixels150
roundbooleanUse round or rectangle shapetrue
blackoutbooleanUse blackout for right side of an avatartrue
avatarColorsstring[]Palette for avatar colors['#d7b89c', '#b18272','#ec8a90','#a1Ac88','#99c9bd','#50c8c6']
backgroundColorsstring[]Palette for background colors['#fcf7d1', '#ece2e1','#e4e3cd','#c4ddd6','#b5f4bc']

Missing a configuration? Raise an issue.

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100