radgrad01.svg 1.0 KB

123456789101112131415161718192021222324252627
  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 width="8cm" height="4cm" 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"
  11. cx="400" cy="200" r="300" fx="400" fy="200">
  12. <stop offset="0%" stop-color="red" />
  13. <stop offset="50%" stop-color="blue" />
  14. <stop offset="100%" stop-color="red" />
  15. </radialGradient>
  16. </defs>
  17. <!-- Outline the drawing area in blue -->
  18. <rect fill="none" stroke="blue"
  19. x="1" y="1" width="798" height="398"/>
  20. <!-- The rectangle is filled using a radial gradient paint server -->
  21. <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"
  22. x="100" y="100" width="600" height="200"/>
  23. </g>
  24. </svg>