some question about blending

I was just taking a look at the following tutorial:

But a bit confused at the end. It tries to draw a red rectangle on the top of a blue rectangle with alpha value 0.5;

In the end it calculated the final color (orange) as follows:

New color in framebuffer =
current alpha in framebuffer * current color in framebuffer + (1 - current alpha in framebuffer) * shader’s output color

next it does computation as follows:

new color = 0.5*(0,1,0) + (1-0.5)*(1,0.5,0.5); // (the red was already blended with the white background)
new color = (1, 0.75, 0.25) = the same orange <– confusion here;

Should not the new color be: (0.5, 0.75, 0.25)

Could any one clarify me?

Thank you.

[QUOTE=Lee_Jennifer_82;1280114]
Should not the new color be: (0.5, 0.75, 0.25)[/QUOTE]

Given the math shown, yes.

But when red is at top, shouldn’t be the red component more prominent? The resulting color (0.5, 0.75, 0.25) shows green is prominent here.

Yes.

That tutorial seems incoherent and self-contradictory. I suggest looking for a better tutorial.