Soheil
Soheil

Reputation: 1706

android-how to make a high quality 4 color gradient?

it is possible to make a gradient with 2 or 3 colors in Android. now is it possible to make a high quality gradient with 4 colors? I'm emphasizing on quality as there are some ways like putting 2 gradients beside each other but I think doesn't produce high quality result... enter image description here

Upvotes: 9

Views: 3745

Answers (1)

dangVarmit
dangVarmit

Reputation: 5661

You can't create a 4 color gradient as a resource (in xml) but you can use the android.graphics.LinearGradient class to create one with more than 3 colors. The constructor takes an array of colors and an array of positions.

Upvotes: 2

Related Questions