I am working on developing a unique system that involves utilizing various div elements and adjusting their opacity levels.
Here are some specific examples I am dealing with: envision all the divs being black. - When two divs overlap, each with an opacity of X, the resulting overlap area will have an overall opacity of 1.
- Imagine having 10 divs overlapping. These divs have varying opacities - x1, x2, ..., x10. The overlap area where all 10 divs intersect will display an opacity of 1. The overlap areas involving fewer than 10 divs will appear more transparent in comparison.
I am seeking guidance on how to develop an algorithm to determine the optimal "X" opacity parameter for each individual div.
Thank you for your assistance.
SOLVED!
The final opacity formula is calculated as follows: final opacity = 1-(1-op1)(1-op2) or op1+op2-op1*op2.
Another important equation guiding this process is: log 0.01 = x*log(op), where the opacity of the single level (op) plays a crucial role.
This solution was graciously shared by my brilliant friend.