0.0.4 • Published 5 years ago
color-gradient v0.0.4
Color Gradient
A package for generate colors between two colors
Installation
npm install color-gradient --save
Usage
var generate = require("color-gradient");
// generate(start_color, end_color, midpoint, options)
var colors = generate("#fff", "#000", 6, { has_heads: true, output: "rgb" });
Return
["rgb(255,255,255)", "rgb(219,219,219)", ..."rgb(0,0,0)"];
Options
Option | Type | Defalut | Description |
---|---|---|---|
output | String | 'rgb' | 'rgb' or 'hex' change output type |
has_heads | Boolean | true | Include input data with start and end |
Test
npm test
Todos
- RGB input support