0

I tried to write a HTML that enables the user to create a element with angle and color(rgba). I want the cross part to be opaque that each element has transparency However, I can not use the simple way to do this because the cross area is still not opaque(0.5*0.5=0.75)

I want to ask for a solution to make the cross part of two element be opaque by using CSS or JavaScript.
It must be completely filled into the area. However, the element will have angle so simple JavaScript to calculate it is not working.
I wonder if someone can give me a solution.

Han Han
  • 328
  • 12

2 Answers2

4

opacity doesn't add like that..

it is like discount of 50% + 50%.. if original price is 100 . you get first discount your price is 50 but with second discount, it is 25 more so final price will be 25

for case of opacity... you have one layer which lets 50% of light through it .. and 2nd layer also 50% so basically 50% of the 50% of the lowermost layer.

easy way to think is that both of them have some transparency so together they can't be fully opaque

ashish singh
  • 6,526
  • 2
  • 15
  • 35
2

Imagine that are two glasses, red glass, and green glass. When you put the red glass on top of green glass, it is an overlay, not an addition. You can try it in real life

isc_4r
  • 36
  • 4