public static Color makeBrighter(Color color,float factor){
  int red=color.getRed();
  int green=color.getGreen();
  int blue=color.getBlue();
  float[] hsb=Color.RGBtoHSB(red,green,blue,null);
  if (hsb[2] == 1) {
    red+=150;
    green+=150;
    blue+=150;
    if (blue > 255) {
      blue=255;
    }
    if (red > 255) {
      red=255;
    }
    if (green > 255) {
      green=255;
    }
    hsb=Color.RGBtoHSB(red,green,blue,null);
  }
  return Color.getHSBColor(hsb[0],hsb[1],factor * (1f + hsb[2]));
}

public static Color makeBrighter ( Color color , float factor ) { int red = color . getRed ( ) ; int green = color . getGreen ( ) ; int blue = color . getBlue ( ) ; float [ ] hsb = Color . RGBtoHSB ( red , green , blue , null ) ; if ( hsb [ 2 ] == 1 ) { red += 150 ; green += 150 ; blue += 150 ; if ( blue > 255 ) { blue = 255 ; } if ( red > 255 ) { red = 255 ; } if ( green > 255 ) { green = 255 ; } hsb = Color . RGBtoHSB ( red , green , blue , null ) ; } return Color . getHSBColor ( hsb [ 0 ] , hsb [ 1 ] , factor * ( 1f + hsb [ 2 ] ) ) ; }
tries to make the given color brighter . might not work very well with colors like 0000ff because hsb [ 2 ] is already 1 . 0 .
