code: protected Color desaturate(Color color) {
          float[] tmp = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
  
          tmp[1] /= 3.0f;
          tmp[2] = clamp(1.0f - (1.0f - tmp[2]) / 3f);
  
          return new Color((Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF));
      }
docs: Returns a new color with the saturation cut to one third the original,
  and the brightness moved one third closer to white.
  
  @param  color the original color.
  
  @return the new color.