roblarsen/CanvasJS — pull request #9 by kdimatteo (2013-01-24 23:44:30+00:00)
Title: star methog

Wanted to learn a little canvas so I refactored an old method from AS3. Tried to follow your conventions and added a demo page.

usage:

ctx.star({
"x" : Math.random() * ctx.width,
"y" : Math.random() * ctx.height,
"points" : Math.round(Math.random() * 20 + 3),
"innerRadius" : Math.random() * 100,
"outerRadius" : Math.random() * 100,
"angle" : 27,
"fillStyle" : "#" + Math.floor(Math.random()*16777215).toString(16),
"strokeStyle" : "#" + Math.floor(Math.random()*16777215).toString(16)
});