interpolateColorList function

List<Color> interpolateColorList(
  1. List<Color> a,
  2. List<Color> b,
  3. double alpha
)

Implementation

List<Color> interpolateColorList(List<Color> a, List<Color> b, double alpha) {
  assert(a.length == b.length);
  var arrayA = Array(values: a.map((color) => color.toList()).toList());
  var arrayB = Array(values: b.map((color) => color.toList()).toList());

  var interpolatedArray = interpolate<Array>(arrayA, arrayB, alpha);

  var colorList = interpolatedArray.values
      .map((row) => Color(r: row[0], g: row[1], b: row[2], a: row[3]))
      .toList();
  return colorList;
}