我想知道爲什麼中間部分的rgb值與(217,217,166)See this color一起出來。css背景色組合
我可以理解其餘的結果。
div類的背景顏色是繪製在右側的,來自這個等式。
(0 * 0.5 + 255 * 0.5,0 * 0.5 + 255 * 0.5,255 * 0.5 + 255 * 0.5)並且在一些上舍入時,它給出了我們(128,128,255)。
div類的背景顏色,這是下面畫的,來自這個方程。
(255 * 0.35 + 255 * 0.65,255 * 0.35 + 255 * 0.65,0 * 0.35 + 255 * 0.65),並且它給出了我們(255,255,166)。
<div class="a">
<div class="b">
</div>
</div>
.a {
background-color: blue;
width: 300px;
height: 100px;
opacity: 0.5;
}
.b {
background-color: yellow;
width: 100px;
height: 200px;
opacity: 0.7;
}
https://jsfiddle.net/xL73t8qj/
按照我從[Alpha混合規則](https://www.w3.org/TR/2003/REC-SVG11-20030114/masking.html#SimpleAlphaBlending)中讀取的規則,在產生藍色時不應考慮它(217 ,217,166)?另外,那麼在右側和下面的剩餘顏色如何?根據你的解釋,它應該是(255 * 0.5 + 0 * 0.5,255 * 0.5 + 0 * 0.5,255 * 0.5 + 255 * 0.5)和(255 * 0.3, + 255 * 0.7,255 * 0.3 + 255 * 0,7,255 * 0.3 + 0 * 0.7) –