Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <canvas id="canv" width = "460" height = "360" style=background: hsla(0, 1000%, 100%, 1);>
- </canvas>
- <script>
- var c = document.getElementById("canv");
- var ctx = c.getContext("2d");
- id = ctx.createImageData(460,360);
- 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 -= 5) {
- r = Math.random();
- id.data[p] = id.data[p+1] = id.data[p+2] = 12 * Math.pow(r, 1.6);
- id.data[p+4] +=5;
- }
- ctx.putImageData(id, 0, 0);
- }
- draw();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement