Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 931 Bytes

README.md

File metadata and controls

50 lines (32 loc) · 931 Bytes

gravatary

The Gravatar Generator

demo

Installation

npm i gravatary --save

Usage:

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,...

Options

Property Type Description
margin float inner margin
size int px. size of an image
background array of int RGB background for a gravatat