code: public static int alphaMixColors(int backgroundColor, int foregroundColor) {
  		final byte ALPHA_CHANNEL = 24;
  		final byte RED_CHANNEL = 16;
  		final byte GREEN_CHANNEL = 8;
  		final byte BLUE_CHANNEL = 0;
  
  		final double ap1 = (double) (backgroundColor >> ALPHA_CHANNEL & 0xff) / 255d;
  		final double ap2 = (double) (foregroundColor >> ALPHA_CHANNEL & 0xff) / 255d;
  		final double ap = ap2 + (ap1 * (1 - ap2));
  
  		final double amount1 = (ap1 * (1 - ap2)) / ap;
  		final double amount2 = amount1 / ap;
  
  		int a = ((int) (ap * 255d)) & 0xff;
  
  		int r = ((int) (((float) (backgroundColor >> RED_CHANNEL & 0xff) * amount1) +
  				((float) (foregroundColor >> RED_CHANNEL & 0xff) * amount2))) & 0xff;
  		int g = ((int) (((float) (backgroundColor >> GREEN_CHANNEL & 0xff) * amount1) +
  				((float) (foregroundColor >> GREEN_CHANNEL & 0xff) * amount2))) & 0xff;
  		int b = ((int) (((float) (backgroundColor & 0xff) * amount1) +
  				((float) (foregroundColor & 0xff) * amount2))) & 0xff;
  
  		return a << ALPHA_CHANNEL | r << RED_CHANNEL | g << GREEN_CHANNEL | b << BLUE_CHANNEL;
  	}
docs: /* Use alpha channel to compute percentage RGB share in blending.
  * Background color may be visible only if foreground alpha is smaller than 100%