lerp method

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

Linearly interpolate between two ColorScheme objects.

null

Implementation

static ColorScheme lerp(ColorScheme a, ColorScheme b, double t) {
  return ColorScheme(
    primary: Color.lerp(a.primary, b.primary, t),
    primaryVariant: Color.lerp(a.primaryVariant, b.primaryVariant, t),
    secondary: Color.lerp(a.secondary, b.secondary, t),
    secondaryVariant: Color.lerp(a.secondaryVariant, b.secondaryVariant, t),
    surface: Color.lerp(a.surface, b.surface, t),
    background: Color.lerp(a.background, b.background, t),
    error: Color.lerp(a.error, b.error, t),
    onPrimary: Color.lerp(a.onPrimary, b.onPrimary, t),
    onSecondary: Color.lerp(a.onSecondary, b.onSecondary, t),
    onSurface: Color.lerp(a.onSurface, b.onSurface, t),
    onBackground: Color.lerp(a.onBackground, b.onBackground, t),
    onError: Color.lerp(a.onError, b.onError, t),
    brightness: t < 0.5 ? a.brightness : b.brightness,
  );
}