2021-12-08 22:43:31 +01:00
|
|
|
/**
|
|
|
|
* Scale Interpolation Function.
|
|
|
|
*
|
|
|
|
* @param {number} a start scale
|
|
|
|
* @param {number} b end scale
|
|
|
|
* @param {number} v progress
|
|
|
|
* @returns {string} the interpolated scale
|
|
|
|
*/
|
2021-03-30 11:23:29 +02:00
|
|
|
export default function scale(a, b, v) {
|
2021-12-08 22:43:31 +01:00
|
|
|
// eslint-disable-next-line no-bitwise
|
2021-03-30 11:23:29 +02:00
|
|
|
return `scale(${((a + (b - a) * v) * 1000 >> 0) / 1000})`;
|
|
|
|
}
|