Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // press Ctrl + Shift + J or Cmd + Opt + C and paste this in the console.
- // alternatively, paste the following code in your address bar with "javascript:" in front, without these comments.
- // you can save a bookmark in a similar format. ("javascript:" + code given below)
- // use Right click + copy image and paste it into your art programme's canvas.
- // click the square to remove it.
- var dec=Math.floor(Math.random()*16777216);
- var colour = dec.toString(16);
- var zeros="";
- for(i=0;i<6-colour.length;i++) {zeros+="0";};
- colourName="#"+zeros+colour;
- existingCanvas=document.getElementById("myCanvas");
- if(existingCanvas!=undefined){
- document.body.removeChild(existingCanvas);
- }
- document.body.innerHTML+="<canvas id='myCanvas' style='position:fixed;top:0px;left:0px;width:300px;height:300px;' onclick='this.style.left=\"5000px\"';/>";
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- ctx.fillStyle=colourName;ctx.fillRect(0,0,300,300);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement