interpolateRound function

Interpolator<num> interpolateRound(
  1. num a,
  2. num b
)

Creates a round interpolator that rounds to the nearest integer.

Implementation

Interpolator<num> interpolateRound(num a, num b) {
  return (double t) => (a + (b - a) * t).round();
}