clamp<T> function

Interpolator<T> clamp<T>(
  1. Interpolator<T> interpolator
)

Clamps the interpolation parameter to 0, 1.

Implementation

Interpolator<T> clamp<T>(Interpolator<T> interpolator) {
  return (double t) => interpolator(t.clamp(0.0, 1.0));
}