Skin.SetColor random user colors?
#1
Hello,

I am currently updating AZ:R to Nexus and would like to replace the ColorPicker addon with the new Skin.SetColor function. If I specify a custom color list:

<onclick>Skin.SetColor(focuscolor.name, $LOCALIZE[31695],,special://skin/extras/colors/colors.xml)</onclick>

xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<colors>
    <color name="">ffb3e0ff</color>
    <color name="">ffb2f0ff</color>
    <color name="">ffb3ffff</color>
    <color name="">ffb3fff0</color>
    <color name="">ffb4ffe0</color>
    <color name="">ffb3ffd1</color>
    <color name="">ffb4fec3</color>
    <color name="">ffb3ffb4</color>
    <color name="">ffc2ffb2</color>
    <color name="">ffd1ffb4</color>
    <color name="">ffe0ffb3</color>
    <color name="">fff1ffb4</color>
    <color name="">ffe0e0e0</color><!-- This is the 1st color shown in the panel -->
    <color name="">fffeff99</color>
    <color name="">ffffeb9a</color>
    <color name="">fffed699</color>
</colors>

Image

however, the colors are not displayed in order as they are in colors.xml, but imho randomly. Is this normal behavior and I have to live with it? Or will there still be an adjustment here? Smile
Reply
#2
Not used this feature yet, so just a random idea.

Are the colours ordered by name and you've left all the name fields empty? Try naming them 1,2,3.... and so on.
Reply
#3
(2022-11-13, 16:01)roidy Wrote: Not used this feature yet, so just a random idea.

Are the colours ordered by name and you've left all the name fields empty? Try naming them 1,2,3.... and so on.

xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<colors>
    <color name="1">ffb3e0ff</color>
    <color name="2">ffb2f0ff</color>
    <color name="3">ffb3ffff</color>
    <color name="4">ffb3fff0</color>
    <color name="5">ffb4ffe0</color>
    <color name="6">ffb3ffd1</color>
    <color name="7">ffb4fec3</color>
    <color name="8">ffb3ffb4</color>
    <color name="9">ffc2ffb2</color>
    <color name="10">ffd1ffb4</color>
    <color name="11">ffe0ffb3</color>
    <color name="12">fff1ffb4</color>
    <color name="13">ffe0e0e0</color>
    <color name="14">fffeff99</color>
    <color name="15">ffffeb9a</color>
    <color name="16">fffed699</color>
</colors>

xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<colors>
    <color name="a">ffb3e0ff</color>
    <color name="b">ffb2f0ff</color>
    <color name="c">ffb3ffff</color>
    <color name="d">ffb3fff0</color>
    <color name="e">ffb4ffe0</color>
    <color name="f">ffb3ffd1</color>
    <color name="g">ffb4fec3</color>
    <color name="h">ffb3ffb4</color>
    <color name="i">ffc2ffb2</color>
    <color name="j">ffd1ffb4</color>
    <color name="k">ffe0ffb3</color>
    <color name="l">fff1ffb4</color>
    <color name="m">ffe0e0e0</color>
    <color name="n">fffeff99</color>
    <color name="o">ffffeb9a</color>
    <color name="p">fffed699</color>
</colors>

xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<colors>
    <color name="ffb3e0ff">ffb3e0ff</color>
    <color name="ffb2f0ff">ffb2f0ff</color>
    <color name="ffb3ffff">ffb3ffff</color>
    <color name="ffb3fff0">ffb3fff0</color>
    <color name="ffb4ffe0">ffb4ffe0</color>
    <color name="ffb3ffd1">ffb3ffd1</color>
    <color name="ffb4fec3">ffb4fec3</color>
    <color name="ffb3ffb4">ffb3ffb4</color>
    <color name="ffc2ffb2">ffc2ffb2</color>
    <color name="ffd1ffb4">ffd1ffb4</color>
    <color name="ffe0ffb3">ffe0ffb3</color>
    <color name="fff1ffb4">fff1ffb4</color>
    <color name="ffe0e0e0">ffe0e0e0</color>
    <color name="fffeff99">fffeff99</color>
    <color name="ffffeb9a">ffffeb9a</color>
    <color name="fffed699">fffed699</color>
</colors>

Nothing seems to work, but thank you.
Reply
#4
Yep, looking at:- https://github.com/xbmc/xbmc/blob/master...colors.xml

and then the subtitle color picker in the Estuary skin it does appear to be random Sad
Reply
#5
I'm colourblind so apologies if I'm off, but are they listed in some sort of rgb/hex order. That screenshot seems to show them in gradient order rather than random.
Reply
#6
Maybe @ronie can help?
Reply
#7
looking at the source code, the colours are indeed sorted by hue, saturation and lightness.

https://github.com/xbmc/xbmc/blob/ef526d...#L121-L133
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
(2022-11-17, 22:07)ronie Wrote: looking at the source code, the colours are indeed sorted by hue, saturation and lightness.

https://github.com/xbmc/xbmc/blob/ef526d...#L121-L133

Will there be a sort order method available in the future, maybe?
Reply

Logout Mark Read Team Forum Stats Members Help
Skin.SetColor random user colors?0