Guest User

Untitled

a guest
May 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function drawAngleGradient(ctx, options){
  2. var delta = options.endAngle - options.startAngle;
  3. for(var angle = options.startAngle; angle < options.endAngle; angle += options.angleStep){
  4. var t = (angle - options.startAngle) / delta;
  5. drawLine(ctx, {
  6. start: options.center,
  7. end: [
  8. options.center[0] + options.radius * Math.cos(angle),
  9. options.center[1] + options.radius * Math.sin(angle)
  10. ],
  11. color: mixColors(options.startColor, options.endColor, t)
  12. });
  13. }
  14. }
Add Comment
Please, Sign In to add comment