public LEDColor[] From2D(ControlDevice.LedUnit[,] input) { var rrr = new LEDColor[106]; int ct = 0; for (int y = 0; y < input.GetLength(1); y++) { for (int x = 0; x < input.GetLength(0); x++) { var mm = matrixMap[y][x]; if (mm != NA) { if (input[x, y] != null) { rrr[mm] = (input[x, y].Color); ct++; } } } } return(rrr.ToArray()); }