aja-linear-3-ref.html 626 B

1234567891011121314151617181920212223242526
  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. /* this gradient goes at an angle of -45deg through the center of
  9. the box */
  10. var grad = ctx.createLinearGradient(-25,25,125,175);
  11. grad.addColorStop(0, 'yellow');
  12. grad.addColorStop(1, 'blue');
  13. ctx.fillStyle = grad;
  14. ctx.fillRect(0,0,100,200);
  15. document.documentElement.removeAttribute('class');
  16. }
  17. </script>
  18. </head>
  19. <body onload="doDraw();">
  20. <canvas id="canvas" width="100" height="200"></canvas>
  21. </body>
  22. </html>