static int getIndex(int r, int g, int b) { return r * sideLength * sideLength + g * sideLength + b; }