interpolate-arrays
v1.0.4
Published
Linear interpolation between multiple arrays
Downloads
260
Readme
interpolate-arrays
Linear interpolation between multiple arrays
var interpolateArrays = require('interpolate-arrays')
var red = [255, 0, 0]
var green = [0, 255, 0]
var blue = [0, 0, 255]
var yellow = interpolateArrays([red, green, blue], 0.25); //-> [ 127.5, 127.5, 0 ]
Usage
interpolateArrays(arraysList, t[, out])
Linearly interpolates between all arrays in the arraysList
using the t
component. Returns an interpolated array optionally reusing opt
array to avoid allocation.
License
MIT, see LICENSE.md for details.