Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <canvas id="canv" width="1000" height="1000">
- </canvas>
- <script>
- c = document.getElementById("canv");
- var ctx = c.getContext("2d");
- id = ctx.createImageData(1000,1000);
- function draw() {
- var w=c.width;
- var h=c.height;
- window.requestAnimationFrame(draw);
- var r;
- for (var p = 4 * (w * h - 4); p>= 4; p -= 4) {
- r = Math.random();
- id.data[p] = id.data[p+p] = id.data[p+p] = 256 * Math.pow(r, 1.6);
- id.data[p++] = 256;
- }
- ctx.putImageData(id, 0, 0);
- }
- draw();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement