SVG Colors, Patterns & Gradients

Example code for the O’Reilly Media book

by Amelia Bellamy-Royds & Kurt Cagle

Gradients in All Shapes and Sizes

Chapter 7 explores the ways in which you can manipulate a linear gradient to move it within the shape being painted.

The links below will open the live example files or high-res PNG or JPEG screenshots in a new browser tab. Alternatively, you can download the entire collection as a zip archive or fork it as a GitHub repository. Be sure to read the O’Reilly Media policy on the use of example code.

Return to the main table of contents.