BrU32

JS Hex Random Color Code Gen 3D Example SRC

Nov 30th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <html>
  2. <body onload="setInterval(drawe,22)" background-color="black">
  3.  
  4. <canvas id="myCanvas" width="1000" height="1000" style="background:black;">
  5. </canvas>
  6. <script>
  7. var inn=' ';
  8. var outlen=(inn.length*44+9);
  9. var ii=outlen;
  10.  
  11. function drawe(){
  12. var out
  13.  
  14. var text = "";
  15. var possible = "FABCGDE0123456789";
  16. var canvas = document.getElementById("myCanvas");
  17. var ctx = canvas.getContext("2d");
  18. ctx.font="50px Comis Ariel"
  19. for(var i=0; i!=6; i++)
  20. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  21. ctx.strokeStyle='#'+text;
  22. ctx.fillStyle="#"+text;
  23. var c = document.getElementById("myCanvas");
  24. var ctx = c.getContext("2d");
  25. ctx.beginPath();
  26. ctx.fillText(text,ii,ii,100,ii++);
  27. ctx.fill();
  28. text='';
  29. if(outlen<4){
  30. return;
  31. }
  32. }
  33. </script>
  34. </body>
Advertisement
Add Comment
Please, Sign In to add comment