Advertisement
BrU32

JS Canvas TV Screen Test SRC V1

Nov 22nd, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body bgcolor="000000">
  4.  
  5. <canvas id="myCanvas" width="200" height="200" style="border:1px solid #d3d3d3;">
  6. Your browser does not support the HTML5 canvas tag.</canvas>
  7.  
  8. <script>
  9. var c = document.getElementById("myCanvas");
  10. var ctx = c.getContext("2d");
  11.  
  12.  
  13.  
  14. // Fill with gradient
  15. ctx.fillStyle ="red"
  16. ctx.fillRect(20,40,150,80);
  17. ctx.fillStyle ="white"
  18. ctx.fillRect(40,40,150,80)
  19. ctx.fillStyle ="yellow"
  20. ctx.fillRect(60,40,150,80)
  21. ctx.fillStyle ="blue"
  22. ctx.fillRect(80,40,150,80)
  23. ctx.fillStyle ="magenta"
  24. ctx.fillRect(120,40,150,80)
  25. ctx.fillStyle ="limegreen"
  26. ctx.fillRect(140,40,150,80)
  27. ctx.fillStyle ="black"
  28. ctx.fillRect(160,40,200,80)
  29. </script>
  30.  
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement