Summary

   



 Download CD Content

Overview

This chapter introduces the SVG defs element that allows you to define your own graphics elements. The main use of the SVG defs element in this chapter is for defining SVG linear color gradients and radial color gradients that can be used when rendering graphics images. You'll learn how to combine linear gradients and radial gradients, defined in an SVG defs element, with simple geometric objects. In later chapters, you'll see how to combine color gradients with more sophisticated geometric objects. One advantage of defining these gradients in an SVG defs element is that you can use these definitions as 'templates' which can be applied to your graphics components. The definition-based nature of the SVG defs element reduces complexity and redundancy, and hence will simplify maintenance and enhancements to your existing code.

The second part of this chapter shows you how to use embedded and external stylesheets. If you have already worked with cascading stylesheets, this material will be familiar to you, so feel free to skim through it quickly. The advantages of using stylesheets become most evident when you need to maintain several hundred SVG documents, but stylesheets can be useful even when you have a smaller number of SVG documents. One of the most important advantages of stylesheets is that they can simplify code maintenance by providing code structure, which entails performing some code analysis in order to determine their common features. All code and images for this chapter can be found on the companion CD-ROM in the Chapter 2 folder.



   



Fundamentals of SVG Programming. Concepts to Source Code
Fundamentals of SVG Programming: Concepts to Source Code (Graphics Series)
ISBN: 1584502983
EAN: 2147483647
Year: 2003
Pages: 362

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net