interpolateInt function

Interpolator<int> interpolateInt(
  1. int a,
  2. int b
)

Creates an integer interpolator between a and b. Rounds the result to the nearest integer.

Implementation

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