| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
| 3 <style> | 3 <style> |
| 4 svg { | 4 svg { |
| 5 width: 100px; | 5 width: 100px; |
| 6 height: 100px; | 6 height: 100px; |
| 7 background: red; |
| 7 } | 8 } |
| 8 svg rect { | 9 svg rect { |
| 9 fill: black; | 10 fill: black; |
| 10 filter: url(#test); | 11 filter: url(#test); |
| 11 } | 12 } |
| 12 </style> | 13 </style> |
| 13 <body> | 14 <body> |
| 14 <template id="target-template"> | 15 <template id="target-template"> |
| 15 <svg> | 16 <svg> |
| 16 <defs> | 17 <defs> |
| 17 <filter id="test"> | 18 <filter id="test"> |
| 18 <feFlood class="target"></feFlood> | 19 <feFlood x="10" y="10" width="80" height="80" flood-color="blue" class="
target" /> |
| 19 </filter> | 20 </filter> |
| 20 </defs> | 21 </defs> |
| 21 <rect width="100" height="100"></rect> | 22 <rect width="100" height="100"></rect> |
| 22 </svg> | 23 </svg> |
| 23 </template> | 24 </template> |
| 24 <script src="resources/interpolation-test.js"></script> | 25 <script src="resources/interpolation-test.js"></script> |
| 25 <script> | 26 <script> |
| 26 assertInterpolation({ | 27 assertInterpolation({ |
| 27 property: 'flood-color', | 28 property: 'flood-opacity', |
| 28 from: 'orange', | 29 from: '0.25', |
| 29 to: 'blue' | 30 to: '0.75' |
| 30 }, [ | 31 }, [ |
| 31 {at: -5, is: '#ffff00'}, | 32 {at: -1, is: '0'}, // SVG Opacity ranges from 0.0 to 1.0 |
| 32 {at: -0.4, is: '#ffe700'}, | 33 {at: -0.25, is: '0.125'}, |
| 33 {at: 0, is: 'orange'}, // ffa500 | 34 {at: 0, is: '0.25'}, |
| 34 {at: 0.2, is: '#cc8433'}, | 35 {at: 0.25, is: '0.375'}, |
| 35 {at: 0.6, is: '#664299'}, | 36 {at: 1, is: '0.75'}, |
| 36 {at: 1, is: 'blue'}, // 0000ff | 37 {at: 1.25, is: '0.875'}, |
| 37 {at: 1.5, is: 'blue'} | 38 {at: 2, is: '1'}, // SVG Opacity ranges from 0.0 to 1.0 |
| 38 ]); | 39 ]); |
| 39 </script> | 40 </script> |
| 40 </body> | 41 </body> |
| OLD | NEW |