Skip to content

Commit b209858

Browse files
SebastianZsvgeesus
authored andcommitted
Merge pull request w3c#457 from SebastianZ/examples-with-percentages-in-rgb
[compositing-2] Fixed examples with percentages in rgb() functions
1 parent 57fd29f commit b209858

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

compositing-2/Overview.bs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,10 +1034,10 @@ With the <dfn>plus-lighter</dfn> compositing operator, the following steps are p
10341034
grid-area: 1 / 1;
10351035
}
10361036
.from {
1037-
background-color: rgb(100% 0 0 / 50%);
1037+
background-color: rgb(100% 0% 0% / 50%);
10381038
}
10391039
.to {
1040-
background-color: rgb(0 0 100% / 50%);
1040+
background-color: rgb(0% 0% 100% / 50%);
10411041
}
10421042
</pre>
10431043

@@ -1052,7 +1052,7 @@ With the <dfn>plus-lighter</dfn> compositing operator, the following steps are p
10521052
}
10531053
</pre>
10541054

1055-
<p>However, with default <a>source-over</a> compositing, this produces a result of roughly <code>rgb(43% 0 57% / 44%)</code>. This is correct value when "layering" elements, but it's incorrect for a 50% cross-fade.</p>
1055+
<p>However, with default <a>source-over</a> compositing, this produces a result of roughly <code>rgb(43% 0% 57% / 44%)</code>. This is correct value when "layering" elements, but it's incorrect for a 50% cross-fade.</p>
10561056

10571057
<p>Instead, using <a>plus-lighter</a>:</p>
10581058

@@ -1070,7 +1070,7 @@ With the <dfn>plus-lighter</dfn> compositing operator, the following steps are p
10701070
}
10711071
</pre>
10721072

1073-
<p>This results in <code>rgb(50% 0 50% / 50%)</code>, which is correctly "half-way" between the <code>from</code> and <code>to</code> colors.</p>
1073+
<p>This results in <code>rgb(50% 0% 50% / 50%)</code>, which is correctly "half-way" between the <code>from</code> and <code>to</code> colors.</p>
10741074
</div>
10751075

10761076
<h3 id="groupcompositing">Group compositing behavior with Porter Duff modes</h3>

0 commit comments

Comments
 (0)