title: how to draw a wheel of fortune?
body: <p>Im trying to create a game of spin the wheel using this tutorial:</p>
  
  <p><a href="http://www.emanueleferonato.com/2015/07/31/create-a-wheel-of-fortune-for-your-html5-games-with-phaser-in-only-a-few-lines/" rel="noreferrer">http://www.emanueleferonato.com/2015/07/31/create-a-wheel-of-fortune-for-your-html5-games-with-phaser-in-only-a-few-lines/</a></p>
  
  <p>however, this tutorial used an image for the wheel and i want to create it in html5/js. something vaguely like this:</p>
  
  <p><a href="https://www.winkbingo.com/images/lp/301114/spin_the_wheel_image.png" rel="noreferrer">https://www.winkbingo.com/images/lp/301114/spin_the_wheel_image.png</a>
  this is what i have so far:</p>
  
  <pre><code>var ctx = canvas.getContext("2d");
  var end = 0;
  var color = ['#F0F8FF','#FAEBD7','#00FFFF','#7FFFD4','#00FF00','#FF8C00'];
  var labels = ['label1', 'label2','label3','label4','label5','label6'];
  var slices = 6
  
  for (var i = 0; i &lt; slices; i++) {
  ctx.fillStyle = color[i];
  ctx.beginPath();
  ctx.moveTo(canvas.width/2,canvas.height/2);
  ctx.arc(canvas.width/2,canvas.height/2,canvas.height/2,end, ((1/slices)*Math.PI*2)+end ,false);
  ctx.lineTo(canvas.width/2,canvas.height/2);
  ctx.fill();
  end += ((1/slices)*Math.PI*2)+end;
  }
  </code></pre>
  
  <p>i want the number of segments to be able to change by changing the variable slices(between 1-6). and i also want to display the labels on top. then i want to use this canvas instead of the image in that tutorial code so the wheel spins around with the text. hope that wasnt confusing. anyone know how to do this> i dont mind using any libraries etc.</p>