Skip to Content
Mastering SVG
book

Mastering SVG

by Rob Larsen
September 2018
Beginner to intermediate
312 pages
7h 22m
English
Packt Publishing
Content preview from Mastering SVG

Masking

Masking, in contrast to clipping, takes account of attributes beyond the simple shape of the element being cut out. As was mentioned, you leverage the full range of transparent, semi-transparent, or fully opaque pixels. This allows for interesting effects.

The following example shows how multiple masks can be used together. In this example, we make heavy use of the defs section and then compose an image using different reusable elements.

For starters, we create two gradients. One is a linear gradient that has five steps, mostly black, which creates a very intense band of white in the middle of the gradient. The second is a radial gradient, which has a central area of black surrounded by a very large circle of white. Using these for ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern SVG

Modern SVG

Amelia Bellamy-Royds, Kurt Cagle
Using SVG with CSS3 and HTML5

Using SVG with CSS3 and HTML5

Amelia Bellamy-Royds, Kurt Cagle, Dudley Storey
SVG Text Layout

SVG Text Layout

Amelia Bellamy-Royds, Kurt Cagle

Publisher Resources

ISBN: 9781788626743Supplemental Content