简体   繁体   中英

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 (ie mixing two primary colors) but can't figure out how this can be done with overlaying and transparency.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM