Here you can find the source of mergeColor(Color a, Color b)
public static Color mergeColor(Color a, Color b)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static Color mergeColor(Color a, Color b) { return new Color((a.getRed() + b.getRed()) / 2, (a.getGreen() + b.getGreen()) / 2, (a.getBlue() + b.getBlue()) / 2, (a.getAlpha() + b.getAlpha()) / 2 + Math.abs(b.getAlpha() - a.getAlpha())); }//from www .j a v a 2s . co m }