This method of the Device Class retrieves the number of colors used by the device.
public int getNumberOfColors();
Returns the number of colors.