Mercurial > hg > extraction-interface
comparison geotemco/lib/excanvas/testcases/gradient2.html @ 0:b12c99b7c3f0
commit for previous development
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 19 Jan 2015 17:13:49 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b12c99b7c3f0 |
---|---|
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>Gradient Test</title> | |
5 <style> | |
6 | |
7 body { | |
8 text-align: center | |
9 } | |
10 | |
11 </style> | |
12 <!--[if IE]><script type="text/javascript" src="../excanvas.js"></script><![endif]--> | |
13 <script> | |
14 | |
15 window.onload = function() { | |
16 var ctx = document.getElementById('c').getContext('2d'); | |
17 | |
18 var g1 = ctx.createLinearGradient(0, 0, 300, 200); | |
19 g1.addColorStop(0.0, 'rgba(0, 255, 0, 0.0)'); | |
20 g1.addColorStop(1.0, 'rgba(0, 255, 0, 1.0)'); | |
21 | |
22 var g2 = ctx.createLinearGradient(0, 0, 300, 200); | |
23 g2.addColorStop(0.0, 'rgba(0, 255, 0, 1.0)'); | |
24 // VML Bug | |
25 g2.addColorStop(1.0, 'rgba(0, 0, 0, 0.0)'); | |
26 ctx.fillStyle = g1; | |
27 ctx.fillRect(0, 0, 300, 100); | |
28 ctx.fillStyle = g2; | |
29 ctx.fillRect(0, 100, 300, 100); | |
30 }; | |
31 | |
32 </script> | |
33 </head> | |
34 <body> | |
35 | |
36 <canvas id=c width=300 height=200></canvas> | |
37 | |
38 <p>This tests gradients</p> | |
39 | |
40 </body> | |
41 </html> |