KeyStyle.lerp constructor

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

Interpolates fill, label, weight and outline.

Implementation

factory KeyStyle.lerp(KeyStyle a, KeyStyle b, double t) => KeyStyle(
  fill: Color.lerp(a.fill, b.fill, t)!,
  label: Color.lerp(a.label, b.label, t)!,
  labelWeight: FontWeight.lerp(a.labelWeight, b.labelWeight, t)!,
  outline: a.outline == null && b.outline == null
      ? null
      : Color.lerp(
          a.outline ?? b.outline!.withValues(alpha: 0),
          b.outline ?? a.outline!.withValues(alpha: 0),
          t,
        ),
);