getIndex static method

int getIndex(
  1. int r,
  2. int g,
  3. int b
)

Implementation

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