comparison d3s_examples/python-neo4jrestclient/static/platin/lib/excanvas/testcases/gradient.html @ 8:18ef6948d689

new d3s examples
author Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
date Thu, 01 Oct 2015 17:17:27 +0200
parents
children
comparison
equal deleted inserted replaced
7:45dad9e38c82 8:18ef6948d689
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 var g = ctx.createLinearGradient(0, 0, 300, 0);
18 g.addColorStop(0, '#000');
19 g.addColorStop(1 / 7, '#00f');
20 g.addColorStop(2 / 7, '#0f0');
21 g.addColorStop(3 / 7, '#0ff');
22 g.addColorStop(4 / 7, '#f00');
23 g.addColorStop(5 / 7, '#f0f');
24 g.addColorStop(6 / 7, '#ff0');
25 g.addColorStop(1, '#fff');
26 ctx.fillStyle = g;
27 ctx.fillRect(0, 0, 300, 200);
28 };
29
30 </script>
31 </head>
32 <body>
33
34 <canvas id=c width=300 height=200></canvas>
35
36 <p>This tests gradients</p>
37
38 </body>
39 </html>