lerp static method

Interpolate between two positions for animation

Implementation

static NmGalaxyPoint lerp(NmGalaxyPoint a, NmGalaxyPoint b, double t) {
  return NmGalaxyPoint(
    propertyId: a.propertyId,
    x: a.x + (b.x - a.x) * t,
    y: a.y + (b.y - a.y) * t,
    radius: a.radius + (b.radius - a.radius) * t,
    color: Color.lerp(a.color, b.color, t) ?? a.color,
    opacity: a.opacity + (b.opacity - a.opacity) * t,
  );
}