Kodi Community Forum
Colordiffuse for itemlayout ? - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
--- Thread: Colordiffuse for itemlayout ? (/showthread.php?tid=234896)

Pages: 1 2


Colordiffuse for itemlayout ? - tomer953 - 2015-08-10

Hey, I Have white icons which I want to colordiffuse in the same color as the text color. they are inside a list control (skin.shortcuts)
ListItem.Property(TextColor) - is the text color (FFRGB format)

for the label this:
Code:
<label>[COLOR=$INFO[ListItem.Property(TextColor)]]$INFO[ListItem.Label][/COLOR]</label>
is working fine

as for the icon, in the focused layout no problem, but in the itemlayout I need a little help:
Code:
<texture background="true" colordiffuse="$INFO[ListItem.Property(TextColor)]">$INFO[ListItem.Thumb]</texture>
this one is not working, because I guess $INFO is not supported in colordiffuse right?
but if I create a VAR with this INFO, it is working, but effect all the items...and not each one seperatly.
there is any workaround to make it work?


RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-10

although Here I see that $INFO should work for colordiffuse:
http://forum.kodi.tv/showthread.php?tid=158812&pid=1437421#pid1437421

and I tried :
Code:
colordiffuse="$INFO[Skin.String(some_string)]"
and It worked, so why:
Code:
colordiffuse="$INFO[ListItem.Property(TextColor)]"

isnt?


RE: Colordiffuse for itemlayout ? - Hitcher - 2015-08-10

Tried?

Code:
colordiffuse="$INFO[Container(ID).ListItem.Property(TextColor)]"



RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-10

Yes, and its working same as VAR - color all the the items with the current focused item. instead of each one with his color.


RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-11

Just to share, I also hardly tried to use strings, but without success..
use Skin.Setstring in the skinshortcuts dialog when I choose the color, and define it to "menu_labelID" and then in the colordiffuse use the right string...
but It seems that its not possible to use $INFO inside $INFO[Skin.String()] - it just wont work.
so I couldnt use something like: colordiffuse="$INFO[Skin.String(menu_$INFO[...(labelID)])]" because of that reason..

I found a very messy workarround - to use the actual color in the "colordiffuse" and add "visible" condition to that color using StringCompare, but it require to create a tons of controls (256 rgb values)

So I still asking for help here..


RE: Colordiffuse for itemlayout ? - Jayz2K - 2015-08-11

(2015-08-11, 00:11)tomer953 Wrote: Just to share, I also hardly tried to use strings, but without success..
use Skin.Setstring in the skinshortcuts dialog when I choose the color, and define it to "menu_labelID" and then in the colordiffuse use the right string...
but It seems that its not possible to use $INFO inside $INFO[Skin.String()] - it just wont work.
so I couldnt use something like: colordiffuse="$INFO[Skin.String(menu_$INFO[...(labelID)])]" because of that reason..

I found a very messy workarround - to use the actual color in the "colordiffuse" and add "visible" condition to that color using StringCompare, but it require to create a tons of controls (256 rgb values)

So I still asking for help here..

Maybe try

colordiffuse="$INFO[Skin.String(menu_$PARAM(LabelID))]

With param value = $INFO[...(labelID)]

I use this trick many times when properties are failing. Advantage of $PARAM is that it's resolved first so it places the correct value directly in place of $PARAM. Works fine for first value of Stringcompare for exemple.

Just a thought


RE: Colordiffuse for itemlayout ? - Hitcher - 2015-08-11

What happens if you move the colordiffuse out?

eg

Code:
<colordiffuse>$INFO[ListItem.Property(TextColor)]</colordiffuse>
<texture background="true">$INFO[ListItem.Thumb]</texture>



RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-11

Tried, same results

Edit:jay i saw now your message, ill try


RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-12

(2015-08-11, 20:34)Jayz2K Wrote:
(2015-08-11, 00:11)tomer953 Wrote: Just to share, I also hardly tried to use strings, but without success..
use Skin.Setstring in the skinshortcuts dialog when I choose the color, and define it to "menu_labelID" and then in the colordiffuse use the right string...
but It seems that its not possible to use $INFO inside $INFO[Skin.String()] - it just wont work.
so I couldnt use something like: colordiffuse="$INFO[Skin.String(menu_$INFO[...(labelID)])]" because of that reason..

I found a very messy workarround - to use the actual color in the "colordiffuse" and add "visible" condition to that color using StringCompare, but it require to create a tons of controls (256 rgb values)

So I still asking for help here..

Maybe try

colordiffuse="$INFO[Skin.String(menu_$PARAM(LabelID))]

With param value = $INFO[...(labelID)]

I use this trick many times when properties are failing. Advantage of $PARAM is that it's resolved first so it places the correct value directly in place of $PARAM. Works fine for first value of Stringcompare for exemple.

Just a thought

Can you guide me how to call it exactly ? I tried:
Code:
<colordiffuse>$INFO[Skin.String(menu_$PARAM(labelID))]</colordiffuse>

Code:
<include name="labelID">
    <param name="labelID" value="$INFO[ListItem.Property(labelID)]"/>
</include>

But its not working

Also tried:
Code:
<include name="foo">
        <control type="image">
            <height>57</height>
            <width>10</width>
            <texture colordiffuse="$INFO[Skin.String(menu_$PARAM(boo))]" background="true">white.png</texture>
        </control>
    </include>
in the includes.xml file and:
Code:
<include name="foo">
                        <param name="boo" value="$INFO[Container(9000).ListItem.Property(labelID)]" />
                    </include>
inside the itemlayout part...
I always check ListItem and Container(9000).Listitem, they both returns nada


RE: Colordiffuse for itemlayout ? - Jayz2K - 2015-08-12

For first attempt you need to call the include

Include def
Code:
<include name="Mytest">
     <colordiffuse>$INFO[Skin.String(menu_$PARAM(labelID))]</colordiffuse>
</include>

Include call in the list
Code:
<include name="Mytest">
     <param name="labelID" value="$INFO[ListItem.Property(labelID)]"/>
</include>

... But second one seems OK
Complete code is always better.

Have you checked that your ListItem.Property is returning correct value with just placing it like a label in your list ?


RE: Colordiffuse for itemlayout ? - mkortstiege - 2015-08-12

A simple test scenario to reproduce would be extremely handy Wink


RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-12

Code:
$INFO[ListItem.Property(TextColor)]
inside "label" return the textcolor as it should (FFRGB type) - each item has his own color.

The $PARAM Trick is not working...
I Tried different things, even tried to manually Set string to some color, like:
Skin.SetString(menu_movies,FFd2d2d2) and then test the param with:
Code:
<control type="image">
                        <texture background="true">white.png</texture>
                        <include name="Mytest">
                            <param name="labelID" value="movies"/>
                        </include>
</control>
(as you can see I put "movies" in the value just to test... of course I tried $INFO with labelID first...
and the include:
Code:
<include name="Mytest">
<colordiffuse>$INFO[Skin.String(menu_$PARAM(labelID))]</colordiffuse>
</include>
and its not working.....
mkortstiege, I am using list id 9000 with skin.shortcuts, and trying to colordiffuse "white.png" texture (simple 4x4 white.png file) with property that contains FFRGB value... or with skin string that include that...
I don't know how to give you some test code to do the same without the whole script, but I will try later to think about something...
I think everyone here can put a new Image control in his own skin main menu, white white texture, and try to colordiffuse it with some string or property...


and it


RE: Colordiffuse for itemlayout ? - mkortstiege - 2015-08-12

Will check.


RE: Colordiffuse for itemlayout ? - Jayz2K - 2015-08-12

Gave it a quick shot in my home menu and have the same result. Using skin.string or var in itemlayout return the focusedlayout item's property value. Param doesn't work at all for this one.


RE: Colordiffuse for itemlayout ? - tomer953 - 2015-08-12

mkortstiege - Thanks...
Jay, I also tried very basic test before messing with all the $INFO and stuff, and it seems like colordiffuse just don't work with $PARAM, I tried this one:
Code:
<include name="Mytest">
    <texture colordiffuse="$PARAM(noob)">white.png</texture>
</include>
Code:
<control type="image">
<include>image_size</include>
<include name="Mytest">
    <param name="noob" value="red" />
</include>
</control>
not working...

I just need to think about some trick to make this: http://forum.kodi.tv/showthread.php?tid=234896&pid=2076341#pid2076341 to work seperatly for each menu and not for all of them.. arr


This forum uses Lukasz Tkacz MyBB addons.