lerp static method

ColorRole? lerp(
  1. ColorRole? a,
  2. ColorRole? b,
  3. double t
)

Linearly interpolates between two ColorRoles.

Implementation

static ColorRole? lerp(ColorRole? a, ColorRole? b, double t) {
  if (identical(a, b)) return a;
  if (a == null || b == null) return t < 0.5 ? a : b;
  return ColorRole(
    Color.lerp(a.background, b.background, t)!,
    Color.lerp(a.text, b.text, t)!,
  );
}