Skip to Main Content
SVG for Web Developers
book

SVG for Web Developers

by Ellen Pearlman, Lorien House
December 2002
Beginner to intermediate content levelBeginner to intermediate
464 pages
8h 34m
English
Pearson
Content preview from SVG for Web Developers

Gradients

Objects in SVG can be filled or stroked with gradients, as well as with solid colors. A gradient is a smooth transition, or fade, from one color to another, or through a series of colors into other colors. You can use two types of gradients in SVG, linear gradients and radial gradients.

Linear Gradients

Figure 5-2 shows a rectangle filled with a linear gradient.

Figure 5-2. Rectangle with linear gradient fill (linearGrad01.svg).

This rectangle has a two-color gradient that spans from red on the left to yellow on the right. (The image shown is in grayscale for this book). Example 5-2 provides the code for this image in Figure 5-2.

Example ...
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

Building Web Applications with SVG

Building Web Applications with SVG

Jon Frost David Dailey and Domenico Strazzullo
SVG Text Layout

SVG Text Layout

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

Using SVG with CSS3 and HTML5

Amelia Bellamy-Royds, Kurt Cagle, Dudley Storey

Publisher Resources

ISBN: 0131004999Purchase book