Created
June 20, 2011 14:13
-
-
Save superbrothers/1035670 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>STAR - Canvas</title> | |
</head> | |
<body> | |
<canvas id="star" width="12px" height="11px"></canvas> | |
</body> | |
<script><!-- | |
var canvas = document.getElementById('star'); | |
var context = canvas.getContext('2d'); | |
// Style | |
context.fillStyle = 'rgb(255, 215, 0)'; | |
context.strokeStyle = 'rgb(255, 215, 0)'; | |
context.lineWidth = 1; | |
// Path | |
context.beginPath(); | |
context.moveTo(0, 4); | |
context.lineTo(12, 4); | |
context.lineTo(2, 11); | |
context.lineTo(6, 0); | |
context.lineTo(10, 11); | |
context.lineTo(0, 4); | |
context.closePath(); | |
context.fill(); | |
context.stroke(); | |
--></script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment