Chapter 5. Color, Gradients, and Patterns

In This Chapter

  • Colors in SVG: Filling and Stroking

  • Gradients

  • Patterns

  • Conclusion

Chapter 3, Basic Shapes and Text, briefly discussed fill and stroke property values used for coloring images, so you learned how to “paint” (apply color to) images. However, color in SVG is a many-splendored thing! Not only does SVG feature the capability to use RGB (red, green, blue) values, providing an enormous range of colors to choose from, SVG also allows images to be filled and stroked with gradients and patterns. There are many of the same options for painting images in SVG as there are in many other vector drawing packages.

SVG has advantages over bitmap graphics in terms of how it renders colors because SVG uses the ...

Get SVG for Web Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.