Color Effects
This library contains a javascript class. The class provides several color effect generations and provides always an array with colors, whereby the color itself is an array containing a red, green and blue value.
Precondition
The library is implemented in ECMAScript 2015, so your project should support at least this version.
Installation
Install it via npm:
$ npm install color-effects
Usage
Start with importing the module via:
var ColorEffects =
Create an instance providing the number of pixels (lights, leds). This will be the number of colors in the returned array of each effect method.
// 32 pixelsvar effects = 32
Supported Effects
Rainbow
Generate a rainbow:
// generated array starts with red and ends with violetvar rainbow = effects// reversed rainbow (from violet to red)var rainbowReverse = effects
Fade
Generate a color gradient from a color to another color:
// from red to bluevar colors = effects
Random
Generate a collection of random colors:
var chaos = effects
API
Check out the documentation for details.
License
MIT