animal-avatar-generator
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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

Name Type Description Default
size number or string Avatar size in pixels or css property 150 or '75%'
round boolean Use round or rectangle shape true
blackout boolean Use blackout for right side of an avatar true
avatarColors string[] Palette for avatar colors ['#d7b89c', '#b18272','#ec8a90','#a1Ac88','#99c9bd','#50c8c6']
backgroundColors string[] Palette for background colors ['#fcf7d1', '#ece2e1','#e4e3cd','#c4ddd6','#b5f4bc']

Missing a configuration? Raise an issue.

License

MIT

Package Sidebar

Install

npm i animal-avatar-generator

Weekly Downloads

225

Version

1.2.0

License

MIT

Unpacked Size

36.9 kB

Total Files

33

Last publish

Collaborators

  • rlukashik