0

Not a duplication question, so please read first.

I am trying to make my seekbar look like thisSeekbar image . The problem is, there is no such library on github or any code for that for android. How do I do that? This is the closest solution but it supports only 3 colors:

<item android:id="@android:id/background">
<!-- background -->
    <shape>
        <corners android:radius="0dip" />

        <gradient
            android:angle="0"
            android:centerColor="#FF5A00"
            android:centerY="0"
            android:endColor="#FF5A00"
            android:startColor="#FF5A00" />
dglozano
  • 6,369
  • 2
  • 19
  • 38
  • I would guess that the `startColor` `centerColor` and `endColor` defines what major colors to fade between, try change them so that they are not the same colour (FF5A00 is hex for a color code, where FF is full Red, 5A is about 50% of green and 00 is no blue). – Jite Dec 14 '18 at 18:59
  • I have tried it already, I need more colors – user10792337 Dec 14 '18 at 19:02
  • Yes, just try to change the color codes. Each part of the color code is a value between 0 and 255 (hexadecimal: 0-FF). The order is RedGreenBlue. I.E., FF0000 is full red, 00FF00 full green, 0000FF full blue. Play around with it and see if you find a gradient you like. – Jite Dec 14 '18 at 19:05
  • "More colors"? Are you looking for the entire visible color spectrum (or a close approx. thereof) or just how many colors? – Barns Dec 14 '18 at 19:06
  • @Barns closest approx – user10792337 Dec 14 '18 at 19:15
  • @Barns is it possible sir :D – user10792337 Dec 14 '18 at 19:26
  • take a look at the accepted answer to this question. [How to make a drawable with a multicolor gradient?](https://stackoverflow.com/questions/32990598/android-how-to-make-a-drawable-with-a-multicolor-gradient) – Barns Dec 14 '18 at 19:41
  • Does anyone find any answer? I am facing a similar issue but got a whole background gradient. I want only played color gradient – krupa parekh Nov 18 '22 at 05:55

0 Answers0