Here you can find the source of blendColors(Color from, Color to, double toFraction)
public static Color blendColors(Color from, Color to, double toFraction)
//package com.java2s; //License from project: Artistic License import java.awt.Color; public class Main { public static Color blendColors(Color from, Color to, double toFraction) { toFraction = Math.min(1.0, toFraction); double fromFraction = 1 - toFraction; return new Color((int) (from.getRed() * fromFraction + to.getRed() * toFraction), (int) (from.getGreen() * fromFraction + to.getGreen() * toFraction), (int) (from.getBlue() * fromFraction + to.getBlue() * toFraction)); }/*www .j a v a 2 s . c om*/ }