Remove gradient from the edge colors of an arc

36
November 19, 2018, at 07:50 AM

This is my code

        Shader shader = new SweepGradient(mX,mY,new int[]{ Color.YELLOW,Color.BLUE,Color.RED,Color.GREEN}, null);
        mPaint.setShader(shader);
        RectF oval = new RectF(mX - radius, mY - radius, mX + radius, mY + radius);
        canvas.drawArc(oval, 120, 300, false, mPaint);

The arc is getting created and the colors are eventually distributed but the circle becomes like

I want to remove the gradient at the end of Yellow. and also there is no gradient between yellow and green but that should be gradient.

READ ALSO
Multicasting over Ethernet on Android?

Multicasting over Ethernet on Android?

My java app running on an Android 44 tablet receives pretty fine multicast packages over WLAN from a server

69
Android Studio E/RecyclerView: No adapter attached; skipping layout error

Android Studio E/RecyclerView: No adapter attached; skipping layout error

Hi I know this has been asked before but I can't seem to find anything to helpMy app used to work but has all of a sudden stopped and the only thing that has changed is that my phone(which I have been running the app on has updated)

56
Webview when clicking on button Flutter

Webview when clicking on button Flutter

I am using Webviews with Flutter but I can't seem to make it workHere is my code:

101
Flutter: Image BoxFit.cover doesnt work in Stack

Flutter: Image BoxFit.cover doesnt work in Stack

I want two images stack over each other in a gridview and both showing a

42