lerp-css-string
Interpolates the values between two CSS strings, returning a new string.
var lerp = // -> '5px' // -> '75%' // -> '75px 22.5%' // -> '280 75% 37.5%'
Usage
lerp(str1, str2, alpha)
Lerps between str1
and str2
based on the given alpha
(typically 0.0 to 1.0), returning a new string with interpolated values and their units. Numbers and units are expected to be tightly packed (e.g. 50px
).
License
MIT, see LICENSE.md for details.