lerp static method

Linearly interpolates between two styles.

Implementation

static ScriptStyle? lerp(ScriptStyle? a, ScriptStyle? b, double t) {
  if (a == null && b == null) {
    return null;
  }
  if (a == null) {
    return t < 0.5 ? null : b;
  }
  if (b == null) {
    return t < 0.5 ? a : null;
  }
  return ScriptStyle(
    scale: lerpDouble(a.scale, b.scale, t),
    color: Color.lerp(a.color, b.color, t),
  );
}