So, I have two colors:
public final static Color FAR = new Color(255, 255, 60);
public final static Color CLOSE = new Color(0, 255, 255);
Three arrays:
private int R[]=new int[100];
private int G[]=new int[100];
private int B[]=new int[100];
And I try to set there different values:
double ratio;
for(int i=0;i<100;i++) {
ratio = i / 100;
R[i] = (int)Math.abs((ratio * FAR.getRed()) + ((1 - ratio) * CLOSE.getRed()));
G[i] = (int)Math.abs((ratio * FAR.getGreen()) + ((1 - ratio) * CLOSE.getGreen()));
B[i] = (int)Math.abs((ratio * FAR.getBlue()) + ((1 - ratio) * CLOSE.getBlue()));
}
But all values are the same, R always 0, G - 255 and B - 255. Can someone please explain me why?