lerp static method

Linearly interpolates between two NodeTransforms.

Implementation

static NodeTransform? lerp(NodeTransform? a, NodeTransform? b, double t) {
  if (a == null && b == null) return null;
  if (a == null) return b;
  if (b == null) return a;
  return NodeTransform(
    x: lerpDouble(a.x, b.x, t)!,
    y: lerpDouble(a.y, b.y, t)!,
    r: lerpDouble(a.r, b.r, t)!,
    opacity: lerpDouble(a.opacity, b.opacity, t)!,
  );
}