Here you can find the source of mix(double x, double y, double a)
public static double mix(double x, double y, double a)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { public static double mix(double x, double y, double a) { return x + a * (y - x); }/*from w w w . j av a2s . c o m*/ public static Color mix(Color c1, Color c2, double a) { double red = c1.getRed() + a * (c2.getRed() - c1.getRed()); double green = c1.getGreen() + a * (c2.getGreen() - c1.getGreen()); double blue = c1.getBlue() + a * (c2.getBlue() - c1.getBlue()); return new Color((int) red, (int) green, (int) blue); } }