2个相反的不透明度值不产生不透明颜色 [英] 2 opposite opacity values dont produce opaque color

查看:209
本文介绍了2个相反的不透明度值不产生不透明颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成一个具有该颜色的2个不透明度值的不透明纯色。



例如:0.5不透明度黑色矩形不透明度(不透明1)黑色。



我尝试过不同的不透明度值,发现像0.5& 0.8产生0.9不透明度的黑色,0.4& 0.82等。



这些不是准确的值。 如果两个具有不透明度的元素 1->

一个 1-b 堆叠在一起,它们的组合不透明度将是 1-a * b ,所以没有反面的不透明度值这样的东西。
如果你想要两个元素完全不透明,那么其中一个元素必须是完全不透明的。



这也模仿真实世界:when你堆叠两个暗箔,每个吸收50%的光通过,它们的组合不透明度是75%,而不是100%。三片 - 87.5%等。


I want to produce an opaque solid color with 2 opacity values of that color.

eg: 0.5 opacity black color rectangle when placed above same 0.5 opacity black color doesn't give me same result as an opaque (opacity 1) black color.

I have tried this with different range of opacity values and found something like 0.5 & 0.8 produce 0.9 opacity black color, 0.4 & 0.82 and so on.

These are not accurate values. What is the exact formula for calculating exactly opposite opacity values?

解决方案

If two elements with opacity 1-a and 1-b are stacked on top of each other, their combined opacity will be 1-a*b, so there's no such thing as "opposite opacity values". If you want two elements combined to be fully opaque, then one of them has to be fully opaque itself.

This mimics the real world as well: when you stack two dark foils that each absorbs 50% of light passing through, their combined opacity is 75%, not 100%. Three foils - 87.5% and so on.

这篇关于2个相反的不透明度值不产生不透明颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆