$blend method

  1. @override
Color $blend(
  1. Color c1,
  2. Color c2,
  3. double blendWeight
)
override

Implementation

@override
Color $blend(Color c1, Color c2, double blendWeight) {
  int blendComponent(int component1, int component2) {
    return ((component1 * blendWeight) + (component2 * (1 - blendWeight)))
        .toInt();
  }

  return Color.fromARGB(
    blendComponent(c1.alpha, c2.alpha),
    blendComponent(c1.red, c2.red),
    blendComponent(c1.green, c2.green),
    blendComponent(c1.blue, c2.blue),
  );
}