lerp static method

Implementation

static SliderValue? lerp(SliderValue? a, SliderValue? b, double t) {
  if (a == null || b == null) return null;
  if (a.isRanged && b.isRanged) {
    return SliderValue.ranged(
      lerpDouble(a.start, b.start, t)!,
      lerpDouble(a.end, b.end, t)!,
    );
  } else if (!a.isRanged && !b.isRanged) {
    return SliderValue.single(lerpDouble(a.value, b.value, t)!);
  }
  return null;
}