Answer the question
In order to leave comments, you need to log in
How to make a multi gradient?
Good evening! I'm making a gradient for a color selector, but I'm running into a problem. More than two colors cannot be specified. Tell me how to make a gradient of more than two colors?
It should look something like this:
Answer the question
In order to leave comments, you need to log in
Algorithmically:
1. Choose N colors between which we make a gradient;
2. Choose the order in which they appear in it;
3. Determine the distance between the colors;
4. We put colors at this distance and draw gradients in the usual way between each two;
5. ???;
6. Gradient.
Did I understand you correctly?
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:angle="45"
android:endColor="#87CEEB"
android:centerColor="#768087"
android:startColor="#000"
android:type="linear" />
</shape>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question