It is not difficult, you need to create a radial gradient paint with the center in the middle of the curve. Then in colors [] you add as many colors as you want. You can set null for positions , then the colors will be evenly distributed.
myPaint.setShader(new RadialGradient( float x, float y, float radius, int[] colors, float[] positions, Shader.TileMode tile));
You should also apply this only when shaping the path; you will need to get the bounds of the path using
RectF bounds = new RectF(); myPath.computeBounds(bounds, true);
Now you can easily find the center and radius.
Lumis source share