Here you can find the source of blendColorKeepAlpha(Color source, Color dest)
public static Color blendColorKeepAlpha(Color source, Color dest)
//package com.java2s; import java.awt.*; public class Main { public static Color blendColorKeepAlpha(Color source, Color dest) { return new Color( (int) (source.getRed() + (float) (dest.getRed() - source.getRed()) * (dest.getAlpha() / 255.0f)), (int) (source.getGreen() + (float) (dest.getGreen() - source.getGreen()) * (dest.getAlpha() / 255.0f)), (int) (source.getBlue() + (float) (dest.getBlue() - source.getBlue()) * (dest.getAlpha() / 255.0f)), source.getAlpha());//from www . j av a 2s. c om } }