lerp method

  1. @useResult
FAvatarStyle lerp(
  1. FAvatarStyle other,
  2. double t
)

Linearly interpolate between this and another FAvatarStyle using the given factor t.

Implementation

@useResult
FAvatarStyle lerp(FAvatarStyle other, double t) => .new(
  backgroundColor: .lerp(backgroundColor, other.backgroundColor, t) ?? backgroundColor,
  foregroundColor: .lerp(foregroundColor, other.foregroundColor, t) ?? foregroundColor,
  textStyle: .lerp(textStyle, other.textStyle, t) ?? textStyle,
  fadeInDuration: t < 0.5 ? fadeInDuration : other.fadeInDuration,
);