node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

fade-steps

fade-steps

Generate an array of steps for fading between colours

Install

$ npm install --save fade-steps

Usage

const fadeSteps = require('fade-steps')
 
const startColour = '000000'
const endColour = 'ff00ff'
const stepCount = 5
 
const colours = fadeSteps(startColour, endColour, stepCount)
 
console.log(colours)
/*
[ '000000', '400040', '800080', 'bf00bf', 'ff00ff' ]
*/

Licence

MIT © Ben Evans