from-red-to-green
v1.0.2
Published
Get a color from red to green, based on a percentage number.
Downloads
5
Readme
from-red-to-green
Get a color from red to green, based on a percentage number.
Installation
Install the package with NPM:
$ npm install from-red-to-green
Usage
The package exposes a function that accepts a number between 0 and 1 as an argument, and returns a HSL color string that can be used in CSS.
Example:
var fromRedToGreen = require("from-red-to-green");
var red = fromRedToGreen(0);
var orange = fromRedToGreen(0.25);
var yellow = fromRedToGreen(0.5);
var green = fromRedToGreen(1);