| <svg style="display: block; width: 0; height: 0"> |
| <defs> |
| <filter id="blur"> |
| <feGaussianBlur stdDeviation="3 3"/> |
| </filter> |
| <filter id="hue-rotate" color-interpolation-filters="sRGB"> |
| <feColorMatrix type="hueRotate" values="90"/> |
| </filter> |
| </defs> |
| </svg> |
| <canvas id="canvas" width="100" height="100"></canvas> |
| <script> |
| var canvas = document.getElementById('canvas'); |
| var ctx = canvas.getContext('2d'); |
| ctx.fillStyle = '#0f0'; |
| ctx.fillRect(0, 0, 100, 100); |
| ctx.fillStyle = '#f00'; |
| ctx.filter = 'url(#blur)'; |
| ctx.fillRect(10, 10, 20, 20); |
| ctx.filter = 'url(#hue-rotate)'; |
| ctx.fillRect(40, 40, 20, 20); |
| ctx.filter = 'url(#blur)'; |
| ctx.fillRect(70, 70, 20, 20); |
| </script> |