RGBA2RGB

Alpha value both attenuates the background color and the color value

RGB_background= // N/A
RGBA_color= // N/A

Result color

= rgba2rgb(RGB_background, RGBA_color) // N/A

Source code

function rgba2rgb(RGB_background, RGBA_color)
{
    var alpha = RGBA_color.a;

    return new Color(
        (1 - alpha) * RGB_background.r + alpha * RGBA_color.r,
        (1 - alpha) * RGB_background.g + alpha * RGBA_color.g,
        (1 - alpha) * RGB_background.b + alpha * RGBA_color.b
    );
}
RGBA color
RGBA color on RGB background