interpolate-rgb
Interpolate RGB colors.
Install
npm install interpolate-rgb
bower install interpolate-rgb
Usage
var interpolateRGB = ; // Get RGB color in middle of white and black colorsconsole; // [127.5, 127.5, 127.5] // with alpha channelsconsole; // [127.5, 127.5, 127.5, 0.5] // Using partial applicationvar interpolator = ;console; // [127.5, 127.5, 127.5]
API
interpolateRGB(rgb1 /* array of rgb(a) values */, rgb2, t /* target value 0-1 */)
Test
npm test
License
MIT