color = RGB; GrayImageFilter filter = new GrayImageFilter();
java.awt.image.RGBImageFilter filter = null; color = RGB;  DeviceDisplay deviceDisplay = DeviceFactory.getDevice().getDeviceDisplay(); if (deviceDisplay.isColor()) { filter = new RGBImageFilter(); } else { if (deviceDisplay.numColors() == 2) { filter = new BWImageFilter(); } else { filter = new GrayImageFilter(); } }
  public void setColor(int RGB)   {      color = RGB;      GrayImageFilter filter = new GrayImageFilter();      g.setColor(new Color(filter.filterRGB(0, 0, RGB)));  }