aja-linear-1-ref.html 537 B

123456789101112131415161718192021222324
  1. <!doctype html>
  2. <!-- Derived from http://a-ja.net/newgrad.html -->
  3. <html class="reftest-wait">
  4. <head>
  5. <script>
  6. function doDraw() {
  7. var ctx = document.getElementById('canvas').getContext('2d');
  8. var grad = ctx.createLinearGradient(0,0,0,200);
  9. grad.addColorStop(0, 'yellow');
  10. grad.addColorStop(1, 'blue');
  11. ctx.fillStyle = grad;
  12. ctx.fillRect(0,0,100,200);
  13. document.documentElement.removeAttribute('class');
  14. }
  15. </script>
  16. </head>
  17. <body onload="doDraw();">
  18. <canvas id="canvas" width="100" height="200"></canvas>
  19. </body>
  20. </html>