int (double transparency, int channel, int backgroundChannel) { final int result = (int)(backgroundChannel * (1 - transparency) + channel * transparency); if (result < 0) { return 0; } return Math.min(result, 255); }