Skip to content

Commit

Permalink
ended double use of color to prevent misunderstanding
Browse files Browse the repository at this point in the history
background is usually white in the browser
fill of the circle is default black

Black and white are also used in defining the mask, that's why I propose different colors for 'background' and the circle's fill
  • Loading branch information
steltenpower committed Jul 27, 2023
1 parent 5767d8d commit 7c0a442
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/en-us/web/svg/element/mask/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ svg {

```html
<svg viewBox="-10 -10 120 120">
<rect x="-10" y="-10" width="120" height="120" fill="blue"/>
<mask id="myMask">
<!-- Everything under a white pixel will be visible -->
<rect x="0" y="0" width="100" height="100" fill="white" />
Expand All @@ -34,7 +35,7 @@ svg {
<polygon points="-10,110 110,110 110,-10" fill="orange" />

<!-- with this mask applied, we "punch" a heart shape hole into the circle -->
<circle cx="50" cy="50" r="50" mask="url(#myMask)" />
<circle cx="50" cy="50" r="50" fill="purple" mask="url(#myMask)" />
</svg>
```

Expand Down

0 comments on commit 7c0a442

Please sign in to comment.