Here you can find the source of interpolate(float firstColor, float secondColor, float stage, float maxStages)
public static int interpolate(float firstColor, float secondColor, float stage, float maxStages)
//package com.java2s; //License from project: Open Source License public class Main { public static int interpolate(float firstColor, float secondColor, float stage, float maxStages) { return (int) (firstColor + (secondColor - firstColor) * stage / maxStages); }/*w w w .j a va 2s. co m*/ }