from-red-to-green

1.0.2 • Public • Published

from-red-to-green NPM version

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);

Package Sidebar

Install

npm i from-red-to-green

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • dstil-dev
  • dstil-admin