Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawAngleGradient(ctx, options){
- var delta = options.endAngle - options.startAngle;
- for(var angle = options.startAngle; angle < options.endAngle; angle += options.angleStep){
- var t = (angle - options.startAngle) / delta;
- drawLine(ctx, {
- start: options.center,
- end: [
- options.center[0] + options.radius * Math.cos(angle),
- options.center[1] + options.radius * Math.sin(angle)
- ],
- color: mixColors(options.startColor, options.endColor, t)
- });
- }
- }
Add Comment
Please, Sign In to add comment