}
public Palette createPalette()
{
int numEntries = 1 << TOTAL_BITS;
Palette result = new Palette(numEntries, 255);
PALETTE_RED = new int[numEntries];
PALETTE_GREEN = new int[numEntries];
PALETTE_BLUE = new int[numEntries];
int index = 0;
for (int r = 0; r < (1 << RED_BITS); r++)
{
for (int g = 0; g < (1 << GREEN_BITS); g++)
{
for (int b = 0; b < (1 << BLUE_BITS); b++)
{
//System.out.println(index + ":" + r + ", " + g + ", " + b);
result.putSample(INDEX_RED, index, RED_VALUES[r]);
PALETTE_RED[index] = RED_VALUES[r];
result.putSample(INDEX_GREEN, index, GREEN_VALUES[g]);
PALETTE_GREEN[index] = GREEN_VALUES[g];
result.putSample(INDEX_BLUE, index, BLUE_VALUES[b]);
PALETTE_BLUE[index] = BLUE_VALUES[b];
index++;
}
}
}