Advertisement
BrU32

JS Canvas Draw Random Filled In Circles SRC V2 Final!!!!!

Jan 19th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <html>
  2. <body onload="setInterval(drawe,22)" background-color="white">
  3. <canvas id="myCanvas" width="1000" height="1000" style="background:black;">
  4. </canvas>
  5. <script>
  6. function drawe(){
  7. var text = "";
  8. var possible = "FABCGDE0123456789";
  9. var canvas = document.getElementById("myCanvas");
  10. var ctx = canvas.getContext("2d");
  11. for(var i=0; i!=6; i++)
  12. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  13. ctx.strokeStyle='#'+text;
  14. ctx.fillStyle="#"+text;
  15. var c = document.getElementById("myCanvas");
  16. var ctx = c.getContext("2d");
  17. ctx.beginPath();
  18. ctx.arc(Math.random()*1000,Math.random()*1000,Math.random()*44,44,2*Math.PI);
  19. ctx.fill();
  20. text='';
  21. }
  22. </script>
  23. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement