BrU32

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

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