code: public int recolorColor (float[] hsv)
      {
          // hue will be wrapped-around by HSBtoRGB, we don't need to do it
          float hue = hsv[0] + offsets[0];
          // the others we must clip
          float sat = Math.min(Math.max(hsv[1] + offsets[1], 0), 1);
          float val = Math.min(Math.max(hsv[2] + offsets[2], 0), 1);
  
          // convert back to RGB space
          return Color.HSBtoRGB(hue, sat, val);
      }
docs: Adjusts the supplied color by the offsets in this colorization, taking the appropriate
  measures for hue (wrapping it around) and saturation and value (clipping).
  
  @return the RGB value of the recolored color.