Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SVG Masking
<!DOCTYPE html>
<html>
<head>
<title>Masking</title>
</head>
<body>
<svg version="1.1" viewBox="0 0 100 100">
<defs>
<mask id="mask" x="0" y="0" width="100" height="100"
maskUnits="userSpaceOnUse">
<circle cx="50" cy="50" r="50" fill="white" />
<circle cx="50" cy="50" r="25" fill="black" />
</mask>
</defs>
<circle cx="50" cy="50" r="50" fill="blue" mask="url(#mask)" />
</svg>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment