I have to create a system that work with some div and their opacity.
I’m going directly to some examples; all the divs are black:
– I have 2 divs and they overlap. The divs have opacity X and X, so the overlap area will result with opacity 1.
- I have 10 divs, and they overlap. The divs have opacity x1, x2, … , x10 and the overlap area of all the divs will result with opacity 1. The overlap area of 9 (of 10) divs will result more transparent than the overlap area of 10 divs, and so on…
How to accomplish this? I need an algorithm that gives me the “X” opacity param of each div.
Thanks all.
SOLVED!
final opacity = 1-(1-op1)(1-op2) or op1+op2-op1*op2
log 0.01 = x*log op
where op is the opacity of the single level
(thanks to a genius friend)
Solution:
final opacity = 1-(1-op1)(1-op2) or op1+op2-op1*op2
log 0.01 = x*log op
where op is the opacity of the single level