Rainbow
This library is based on rainbow-colors-array, but it uses TypeScript and is more flexible.
Installation
npm install rainbow-colors-array-ts
Usage
API:
rainbow(arrayLength, type, pastel);
- arrayLength: number of colors in the array
- type: can be "rgb", "hex" or "hsl"
- pastel: boolean, if true, the colors will be pastel
Examples:
import { rainbow } from "rainbow-colors-array-ts";
const colors = rainbow(7);
import { rainbow } from "rainbow-colors-array-ts";
const colors = rainbow(7, "hex", true);
Other options for the second parameter are "hsl" and "rgb".
import { rainbow } from "rainbow-colors-array-ts";
const colors = rainbow(7, "hsl");