title: Draw a circle in a canvas with several gradient colors
body: <p>I need to draw a circle in an Android canvas, based on a gradient list of colors. I managed to draw it without the gradient, as a set of arcs each having one of the colors in the list, as presented by the following image.</p>
  
  <p><a href="https://i.stack.imgur.com/2El8X.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2El8X.png" alt="enter image description here"></a></p>
  
  <p>How can I draw it with an actual gradient? I tried with the following code to apply a shader to the paint:</p>
  
  <pre><code>Shader shader = new LinearGradient(0, 0, circleWidth, circleHeight, colorList, null, Shader.TileMode.MIRROR);
  paint.setShader(shader);
  canvas.drawCircle(circleWidth / 2, circleHeight / 2, radius, paint);
  </code></pre>
  
  <p>but the result is as follows.</p>
  
  <p><a href="https://i.stack.imgur.com/8T9UX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8T9UX.png" alt="enter image description here"></a></p>