randomShape = function randomShape
(context, width, height, maxradius) {
var c = context;
c.save()
var minradius = 0.1 * maxradius;
var minstroke = 0.5;
var maxstroke = 5.0;
var x = uniformRandom(0, width);
var y = uniformRandom(0, height);
var radius = uniformRandom(minradius, maxradius);
var angle = uniformRandom(0.0, 2.0 * Math.PI);
var sides = randomInt(3,9);
var pointiness = uniformRandom(0.3, 0.9);
var shape = randomChoice(
[circle, regularPolygon, regularQuadraticStar, regularStar]);
c.fillStyle = random_color();
c.strokeStyle = random_color();
c.lineJoin = randomChoice(['round', 'bevel', 'miter']);
c.miterLimit = 10;
c.lineWidth = uniformRandom(minstroke, maxstroke);
shape(c, x, y, radius, angle, sides, pointiness);
c.fill();
c.stroke();
c.restore()
}