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