Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 893
Soheil Avatar asked Sep 13 '13 20:09

Soheil


1 Answers

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.

like image 144
dangVarmit Avatar answered Oct 21 '22 07:10

dangVarmit