• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Do you know how to get more than three colors with XML drawable for a gradient?

zap461

Lurker
I know about the startColor and centerColor and endColor but I need a way to have four colors or more. thanks for your help in this
 
There are two ways
1. Create 5 or more drawables with different gradients. Place them vertically next each to other. If their colors will be consistent, you get smooth transition between them.
2. Place 5 or more drawables one behind other and set transparency of each to, say, 10%. So you can see all of them and get the mix of all.
 
Back
Top Bottom