Here you can find the source of interpolateColor(int a, int b, float w)
private static int interpolateColor(int a, int b, float w)
//package com.java2s; //License from project: Apache License public class Main { private static int interpolateColor(int a, int b, float w) { return Math.max(0, Math.min(255, Math.round(a + (b - a) * w))); }/* ww w . java2 s . c o m*/ }