function transparentColor(backgroundColor, finalColor, transparency){ var color = []; for (var i = 0; i < 3; i++) { color[i] = (finalColor[i] - backgroundColor[i] + backgroundColor[i] * transparency) / transparency; } return color; }
transparentColor([204, 222, 225], [102, 139, 197], .5) = [0, 56, 169]