public static Color deriveColorHSB(Color base,float dH,float dS,float dB){
  float hsb[]=Color.RGBtoHSB(base.getRed(),base.getGreen(),base.getBlue(),null);
  hsb[0]+=dH;
  hsb[1]+=dS;
  hsb[2]+=dB;
  return Color.getHSBColor(hsb[0] < 0 ? 0 : (hsb[0] > 1 ? 1 : hsb[0]),hsb[1] < 0 ? 0 : (hsb[1] > 1 ? 1 : hsb[1]),hsb[2] < 0 ? 0 : (hsb[2] > 1 ? 1 : hsb[2]));
}

public static Color deriveColorHSB ( Color base , float dH , float dS , float dB ) { float hsb [ ] = Color . RGBtoHSB ( base . getRed ( ) , base . getGreen ( ) , base . getBlue ( ) , null ) ; hsb [ 0 ] += dH ; hsb [ 1 ] += dS ; hsb [ 2 ] += dB ; return Color . getHSBColor ( hsb [ 0 ] < 0 ? 0 : ( hsb [ 0 ] > 1 ? 1 : hsb [ 0 ] ) , hsb [ 1 ] < 0 ? 0 : ( hsb [ 1 ] > 1 ? 1 : hsb [ 1 ] ) , hsb [ 2 ] < 0 ? 0 : ( hsb [ 2 ] > 1 ? 1 : hsb [ 2 ] ) ) ; }
derives a color by adding the specified offsets to the base color ' s hue , saturation , and brightness values . the resulting hue , saturation , and brightness values will be contrained to be between 0 and 1 .
