lerpColor function

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

Implementation

Color lerpColor(Color a, Color b, double t) {
  return Color.fromARGB(
    (a.alpha * (1.0 - t) + b.alpha * t).round().clamp(0, 255),
    (a.red   * (1.0 - t) + b.red   * t).round().clamp(0, 255),
    (a.green * (1.0 - t) + b.green * t).round().clamp(0, 255),
    (a.blue  * (1.0 - t) + b.blue  * t).round().clamp(0, 255)
  );
}