I have a SweepGradient defined as
circle_paint.setShader(new SweepGradient(getWidth()/2, getHeight()/2, new int[] { circle_start_color, circle_end_color}, new float[] { 0f, 1f}))
applied to a arch defined as
canvas.drawArc(circle_bounds, circle_start_perc*360f, circle_end_perc*360f, true, circle_paint);
This workes well, but I need the arch to start drawing from the top of the screen, i.e.
canvas.drawArc(circle_bounds, ((circle_start_perc*360f)-90f)%360, circle_end_perc*360f, true, circle_paint);
The problem is that the SweepGradient seems to still start at 0 degrees, and i need it to start at 270 degrees (similar to the translation done on the drawing of the arc). In other words if I have a gradient from white to blue, I need the top of the arc painted white en the last part of the arc painted blue. How can I do this?