lerpColor function

Color? lerpColor(
  1. Color? a,
  2. Color? b,
  3. double t
)

Interpolates two nullable Color values.

A null side is treated as absent, not as transparent: fading an unset colour through transparency would show a ghost of the wrong colour.

Implementation

Color? lerpColor(Color? a, Color? b, double t) {
  if (a == null || b == null) return lerpDiscrete(a, b, t);
  return Color.lerp(a, b, t);
}