You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

transparency.svg 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <svg width="400" height="400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  3. <g>
  4. <text x="20" y="20" style="font-size:18">Transparency in SVG (to PDF)</text>
  5. <text x="20" y="35" style="font-size:12">Shapes</text>
  6. <rect x="30" y="55" width="100" height="80" style="fill:green;stroke:blue;stroke-width:3;fill-opacity:0.5;stroke-opacity:0.6"/>
  7. <rect x="80" y="95" width="100" height="80" style="fill:red;stroke:yellow;stroke-width:3;fill-opacity:0.5"/>
  8. </g>
  9. <g>
  10. <defs>
  11. <filter id="Turb" filterUnits="objectBoundingBox"
  12. x="0%" y="0%" width="100%" height="100%">
  13. <feTurbulence type="fractalNoise" baseFrequency="0.1" numOctaves="1"/>
  14. </filter>
  15. </defs>
  16. <text x="20" y="205" style="font-size:12">Image</text>
  17. <rect x="20" y="210" width="40" height="35" style="fill:blue" />
  18. <text x="60" y="255" style="font-size:20;font-weight:bold">SEE</text>
  19. <rect x="25" y="215" width="100" height="75" style="filter:url(#Turb)" />
  20. </g>
  21. <text x="220" y="35" style="font-size:12">Text</text>
  22. <rect x="240" y="55" width="130" height="50" style="fill:blue"/>
  23. <text x="280" y="75" style="font-size:20;font-weight:bold;fill-opacity:0.6;fill:green">SEE</text>
  24. <text x="250" y="95" style="font-size:20;font-weight:bold;fill-opacity:0.4;fill:orange;stroke:red">THROUGH</text>
  25. <text x="220" y="205" style="font-size:12">Uniform Image Transparency</text>
  26. <defs>
  27. <filter id="matrixGreen" filterUnits="objectBoundingBox"
  28. x="0%" y="0%" width="100%" height="100%">
  29. <feTurbulence type="turbulence" baseFrequency="0.05" numOctaves="2" stitchTiles="noStitch" seed="0" result="turb"/>
  30. <feColorMatrix type="matrix" values="0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1" />
  31. </filter>
  32. </defs>
  33. <rect x="240" y="225" width="100" height="75" style="opacity:0.4;filter:url(#matrixGreen)" />
  34. </svg>