This method of the Device Class retrieves a device palette size.
public int getPaletteSize();
Returns the size of the palette.