Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ctx.moveTo(x,y);
- context.arc(x, y, radius, i*pieAngle, (i+1)*pieAngle, false);
- // size of a pie : it is an angle in radians
- var pieAngle = 2 * Math.PI / hours;
- var hueValue = i * 15;
- context.fillStyle = 'hsl(' + hueValue + ',70%, 60%)';
- function drawSegments(radius) {
- for (var i = 0; i < hours; i++) {
- context.beginPath();
- context.moveTo(x, y);
- context.arc(x, y, radius, i*pieAngle, (i+1)*pieAngle, false);
- context.lineWidth = segmentDepth;
- var hueValue = i * 15;
- context.fillStyle = 'hsl(' + hueValue + ',70%, 60%)';
- // '#'+(Math.random()*0xFFFFFF<<0).toString(16);
- context.fill();
- context.lineWidth = 2;
- context.strokeStyle = '#444';
- context.stroke();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement