|
||||||||
Chapter 7 Filling the shapeExtract Colors in gradients or gradients stop elements This
is the syntax for the ‘stop’ element : <stop
id="name"
Diagram 7-1. Chart for 'stop' syntax Values for offset are from 0% to 100% or
from 0 to 1. For each stop element, offset must be equal to or greater than the
previous stop's offset value. How
understand offset attribute ? To begin, we create linear gradient with two colors only. Colors are defined in stop elements. <defs> We create also radial gradient with same 'stop' elements : <defs> For linear gradients, the offset
attribute represents a location along the gradient vector. For radial
gradients, it represents a percentage distance from (fx,fy) to the edge of the
outermost/largest circle.
Figure 7-3. How work offset for stop element In linear gradient, to fill shape, red
is used from begin to 30% of total length, yellow is used from 70% to end. For radial gradient 'offset' apply to
radius of circles ( we can choose center of circles see after ) Figure 7-4 show some values for offset in linear gradient. For 0 and 100, all rectangle is filled with continuously smooth color transitions from red to yellow. For 50 and 50, we get only red for left part and yellow for right part.
Figure 7-4. Some values for offset in linearGradient element We get this effects with radial gradient in Figure 7-5 for different values of offset attributes. Figure 7-5. Some values for offset in radialGradient element chapters: intro toc intro sample svg elements toc svg elements sample |
|
|||||||
|
| Rainbow Seeker | SVG PHP
Learn SVG: Contact Learn SVG
©2002-2008 Learn SVG. All Rights Reserved. Questions and comments to: learnsvg@gmail.com |
||||||||