public static Color fadeToColor(Color source,Color target,float ratio){
  int r=(int)((1 - ratio) * source.getRed() + ratio * target.getRed());
  int g=(int)((1 - ratio) * source.getGreen() + ratio * target.getGreen());
  int b=(int)((1 - ratio) * source.getBlue() + ratio * target.getBlue());
  int a=(int)((1 - ratio) * source.getAlpha() + ratio * target.getAlpha());
  return new Color(r,g,b,a);
}

public static Color fadeToColor ( Color source , Color target , float ratio ) { int r = ( int ) ( ( 1 - ratio ) * source . getRed ( ) + ratio * target . getRed ( ) ) ; int g = ( int ) ( ( 1 - ratio ) * source . getGreen ( ) + ratio * target . getGreen ( ) ) ; int b = ( int ) ( ( 1 - ratio ) * source . getBlue ( ) + ratio * target . getBlue ( ) ) ; int a = ( int ) ( ( 1 - ratio ) * source . getAlpha ( ) + ratio * target . getAlpha ( ) ) ; return new Color ( r , g , b , a ) ; }
utility function returning a new color faded to a target color
