简体   繁体   English

颜色混合RGB模型:透明度

[英]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. 使用50%透明度重叠这些形状以形成二次色(黄色,品红色,青色)。

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. 如果覆盖绿色(rgb 0,1,0),红色(rgb 1,0,0)的透明度为50%,则会得到rgb颜色(0.5,0.5,0),这是一种深黄色。

Why do you get (.5 .5 0) ? 你为什么得到(.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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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