1.0.3 • Published 2 years ago

rainbow-square v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

rainbow-square

Create a dataURL for a square with a rainbow gradient.

GitHub release Build Status codecov Codacy Badge

rainbow-square

Install

You can install via npm or yarn.

npm

npm install --save rainbow-square

yarn

yarn add rainbow-square

Documentation

This documentation is written in TypeScript, however this library works fine in vanilla JavaScript too.

Usage

The async function will return a dataURL which can be used in the src attribute of an img tag.

import { rainbowSquare } from 'rainbow-square';

async function myFn(): Promise<void> {
  const image = document.createElement('img');

  img.src = await rainbowSquare(256);

  document.body.appendChild(img);
}

void myFn();

You can also provide a height if you want to generate an rainbow gradient that isn't a square.

1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago