In this post we set two different color to button diagonally with custom parameters.
Two create custom button we create custom button class in java.
By using this class you can set two different color to button with given percentage.
In this example below method is used for pass two different color and percentage parameter.
If you pass 30% to method parameter and first color is GREEN and second color is RED than output is like this
Suppose if you pass 60% to parameter and first color is GREEN and second color is RED than output is like this
Method code is like this

