Created
May 27, 2017 17:02
-
-
Save karbassi/2c2d798b9fc881cf323226817ba5889a to your computer and use it in GitHub Desktop.
This file contains hidden or 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('drawing'); | |
var ctx = canvas.getContext('2d'); | |
// FACE | |
ctx.beginPath(); | |
ctx.arc(250, 250, 200, 0, 2 * Math.PI); | |
ctx.strokeStyle = 'black'; | |
ctx.stroke(); | |
ctx.fillStyle = 'yellow'; | |
ctx.fill(); | |
// LEFT EYE | |
ctx.beginPath(); | |
ctx.arc(175, 175, 25, 0, 2 * Math.PI); | |
ctx.fillStyle = "black"; | |
ctx.fill(); | |
ctx.stroke(); | |
// RIGHT EYE | |
ctx.beginPath(); | |
ctx.arc(325, 175, 25, 0, 2 * Math.PI); | |
ctx.fillStyle = "black"; | |
ctx.fill(); | |
ctx.stroke(); | |
// SMILE | |
ctx.beginPath(); | |
ctx.arc(250, 250, 150, 0, Math.PI); | |
ctx.fillStyle = "white"; | |
ctx.fill(); | |
ctx.lineTo(400, 250); | |
ctx.stroke(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment