lerp method

Between this and other: colours blend, the width eases, the preset and the dots flip at the middle. AnimatedComicTheme animates with it.

Implementation

ComicThemeData lerp(ComicThemeData? other, double t) {
  if (other == null || identical(this, other) || t == 0) return this;
  if (t == 1) return other;
  return ComicThemeData._(
    t < .5 ? id : other.id,
    t < .5 ? _palette : other._palette,
    ComicColors.lerp(colors, other.colors, t),
    lerpDouble(width, other.width, t)!,
    t < .5 ? onDots : other.onDots,
    shapes: ComicShapes.lerp(shapes, other.shapes, t),
    strokes: ComicStrokes.lerp(strokes, other.strokes, t),
    density: ComicDensity.lerp(density, other.density, t),
    typeface: ComicTypeface.lerp(typeface, other.typeface, t),
    components: ComicComponentThemes.lerp(components, other.components, t),
    motion: ComicMotion.lerp(motion, other.motion, t),
  );
}