radial_gradient.svg 956 B

1234567891011121314151617181920212223
  1. <?xml version="1.0" standalone="no"?>
  2. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  3. "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  4. <svg viewBox="0 0 800 400" version="1.1"
  5. xmlns="http://www.w3.org/2000/svg">
  6. <desc>Example radgrad01 - fill a rectangle by referencing a
  7. radial gradient paint server</desc>
  8. <g>
  9. <defs>
  10. <radialGradient id="MyGradient" gradientUnits="userSpaceOnUse" cx="400" cy="200" r="300" fx="400" fy="200">
  11. <stop offset="0%" stop-color="red" />
  12. <stop offset="50%" stop-color="blue" />
  13. <stop offset="100%" stop-color="red" />
  14. </radialGradient>
  15. </defs>
  16. <!-- Outline the drawing area in blue -->
  17. <rect fill="none" stroke="blue" x="1" y="1" width="798" height="398"/>
  18. <!-- The rectangle is filled using a radial gradient paint server -->
  19. <rect fill="url(#MyGradient)" stroke="black" stroke-width="5" x="100" y="100" width="600" height="200"/>
  20. </g>
  21. </svg>