Advertisement
BrU32

JS Canvas TV Screen SRC V2

Nov 22nd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body bgcolor="000000">
  4.  
  5. <canvas id="myCanvas" width="300" height="300" 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,250,800);
  17. ctx.fillStyle =""
  18. ctx.fillStyle ="white"
  19. ctx.fillRect(50,40,250,800)
  20.  
  21. ctx.fillStyle ="yellow"
  22. ctx.fillRect(80,40,250,800)
  23. ctx.fillStyle ="blue"
  24. ctx.fillRect(120,40,250,800)
  25. ctx.fillStyle ="magenta"
  26. ctx.fillRect(150,40,250,800)
  27. ctx.fillStyle ="limegreen"
  28. ctx.fillRect(180,40,250,800)
  29. ctx.fillStyle ="black"
  30. ctx.fillRect(210,40,250,800)
  31. </script>
  32.  
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement