static int getIndex(int r, int g, int b) { return (r << (indexBits * 2)) + (r << (indexBits + 1)) + (g << indexBits) + r + g + b; }