concat method

ColorOption concat(
  1. ColorOption other
)

Merge other into this color matrix.

Implementation

ColorOption concat(ColorOption other) {
  List<double> tmp = List.filled(20, 0);
  final a = matrix.toList();
  final b = other.matrix.toList();
  int index = 0;
  for (int j = 0; j < 20; j += 5) {
    for (int i = 0; i < 4; i++) {
      tmp[index++] = a[j + 0] * b[i + 0] +
          a[j + 1] * b[i + 5] +
          a[j + 2] * b[i + 10] +
          a[j + 3] * b[i + 15];
    }
    tmp[index++] = a[j + 0] * b[4] +
        a[j + 1] * b[9] +
        a[j + 2] * b[14] +
        a[j + 3] * b[19] +
        a[j + 4];
  }
  return ColorOption(matrix: tmp);
}