-
-
Save samueltcsantos/4755c252f27c56e1a286 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas = document.getElementById('mycanvas'); | |
var context = canvas.getContext('2d'); | |
context.strokeStyle = '#0000ff'; | |
context.lineWidth = 2; | |
context.beginPath(); | |
context.fillStyle = '#00ff00'; //green | |
context.fill(); | |
context.fillRect(100, 10, 150, 100); | |
context.fillStyle = '#ffff00'; //yellow | |
context.fillRect(10, 10, 50, 50); | |
context.fillStyle = '#ffffff'; //white | |
context.fillRect(10,10, 30, 30); | |
context.fillStyle = '#000000'; //black | |
context.fillRect(200, 180, 30, 30); | |
context.fillStyle = '#990099'; //purple | |
context.fillRect(180, 20, 80, 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment