interpolateRound function Value interpolation

int Function(num) interpolateRound(
  1. num a,
  2. num b
)

Returns an interpolator between the two numbers a and b; the interpolator is similar to interpolateNumber, except it will round the resulting value to the nearest integer.

Implementation

int Function(num) interpolateRound(num a, num b) {
  return (t) {
    return (a * (1 - t) + b * t).round();
  };
}