Kodi Community Forum

Full Version: Skin.SetColor random user colors?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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.
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
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.
Maybe @ronie can help?
looking at the source code, the colours are indeed sorted by hue, saturation and lightness.

https://github.com/xbmc/xbmc/blob/ef526d...#L121-L133
(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?