W
W
Way2017-08-05 20:38:24
Java
Way, 2017-08-05 20:38:24

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:
hue_bg.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Labunsky, 2017-08-05
@YouTy6bl4

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.

S
Shamsudin Serderov, 2017-08-05
@Steein

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 question

Ask a Question

731 491 924 answers to any question