Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body bgcolor="000000">
- <canvas id="myCanvas" width="200" height="200" style="border:1px solid #d3d3d3;">
- Your browser does not support the HTML5 canvas tag.</canvas>
- <script>
- var c = document.getElementById("myCanvas");
- var ctx = c.getContext("2d");
- // Fill with gradient
- ctx.fillStyle ="red"
- ctx.fillRect(20,40,150,80);
- ctx.fillStyle ="white"
- ctx.fillRect(40,40,150,80)
- ctx.fillStyle ="yellow"
- ctx.fillRect(60,40,150,80)
- ctx.fillStyle ="blue"
- ctx.fillRect(80,40,150,80)
- ctx.fillStyle ="magenta"
- ctx.fillRect(120,40,150,80)
- ctx.fillStyle ="limegreen"
- ctx.fillRect(140,40,150,80)
- ctx.fillStyle ="black"
- ctx.fillRect(160,40,200,80)
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement