var canvas = document.createElement("canvas");
canvas.setAttribute("width", window.innerWidth);
canvas.setAttribute("height", window.innerHeight);
document.body.appendChild(canvas);
var ctx = canvas.getContext("2d");
var i;
ctx.fillStyle = "rgb(0, 0, 255)"; // blue
for (i = 0; i < 500; i++)
ctx.fillRect(Math.random() * 600, Math.random() * 600, 1, 1);
/*
run:
draw 500 random blue pixels
*/