The Gravatar Generator
npm i gravatary --save
Create random gravatar
import gravatary from "gravatary";
let image = gravatary(); // data:image/png;base64,...
Create gravatar from hashstring without options.
import gravatary from "gravatary";
let image = gravatary("hashstring"); // data:image/png;base64,...
Create gravatar with hash and options.
import gravatary from "gravatary";
let image = gravatary("hashstring", {margin: 0.08, size: 450, background: [0, 0, 0]}); // data:image/png;base64,...
Property | Type | Description |
---|---|---|
margin | float |
inner margin |
size | int |
px. size of an image |
background | array of int |
RGB background for a gravatat |