HTML5 canvas for multiple color gradient effects

From , 3 Years ago, written in JavaScript, viewed 88 times.
URL https://pastebin.vip/view/94351bc9
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
  6. Your browser does not support the HTML5 canvas tag.
  7. </canvas>
  8.  
  9.  
  10. <script type="text/javascript">
  11.  
  12. var c=document.getElementById("myCanvas");
  13. var ctx=c.getContext("2d");
  14. var grd=ctx.createLinearGradient(0,0,175,50);
  15. grd.addColorStop(0,"#FF0000");
  16. grd.addColorStop(1,"#00FF00");
  17. ctx.fillStyle=grd;
  18. ctx.fillRect(0,0,175,50);
  19.  
  20. </script>
  21.  
  22. </body>
  23. </html>
  24.  
  25. //javascript/4747

Reply to "HTML5 canvas for multiple color gradient effects"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website