james_dean
james_dean

Reputation: 1517

Color Blending RGB Model: Transparency

I'm working through some past exam papers and am given the following question:

Create a processing sketch that creates similar shapes in each of the three primary colors (red,green,blue). Overlap these shapes to form the secondary colors (yellow, magenta, cyan) using 50% transparency.

I understand how to create the secondary colors (i.e. mixing two primary colors) but can't figure out how this can be done with overlaying and transparency.

Upvotes: 0

Views: 466

Answers (1)

Joni
Joni

Reputation: 111259

If you overlay green (rgb 0,1,0) with 50% transparency over red (rgb 1,0,0), you get the rgb color (0.5, 0.5, 0), which is a darkish yellow.

Why do you get (.5 .5 0) ? Well,

red:   1*50% + 0*50% = 0.5
green: 0*50% + 1*50% = 0.5
blue:  0*50% + 0*50% = 0.0

Upvotes: 2

Related Questions