Color Definitions
#1
Let's try this again in the correct forum...

I am using a color picker to set the accent color to the string "accent.color". I have text in my skin that uses the color definition "Accent". It doesn't seem possible to set this to a string or variable (as per the wiki and personal experience). Is there a workaround I am not thinking of? This is needed in particular for labels in which I have two colors in one label (for example- movie name (white) movie year (accent) ).
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#2
you can use
Code:
<label>[COLOR white]movie title[/COLOR] [COLOR accent]movie year[/COLOR]</label>
not sure if i completely understood your question though. it would help if you would post the corresponding code snippets.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Phil,

I am moving my skin from a preset list of accent colors (themes) to using a color picker to select the accent colors. With the picker colors are set for like this-

Code:
<item id="28">
   <onclick>Skin.SetString(accent.color,ffed2914)</onclick>
   <onclick>Close</onclick>
   <thumb>colors/FFed2914.png</thumb>
   <label>FFed2914</label>
</item>

Prior to doing this, I used the code you have in your example for instances where I had two colors I one label. However since XBMC doesn't allow colors (in this case Accent) to be defined as anything but hex values in the theme XMLs so I cannot set "Accent" to equal this string. This isn't a problem is most cases as I can use <textcolor> for any text that uses the accent color for the entire label. It is the labels where I need both colors that the issue arises.
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#4
first of all you do not need pngs for every color. easier would be in your case to just use
Code:
<colordiffuse>$INFO[ListItem.Label]</colordiffuse>
on a white image in item/focussedlayout. that saves you some work.

it would not make sense to put anything "dynamic" like vars or strings into the color xmls since they should provide your "default" values for every theme.
you can use variables for example though if you want to override those default values, like
Code:
<variable name="FontColor">
        <value condition="!IsEmpty(Skin.String(CustomColor))>$INFO[Skin.String(CustomColor)]</value>
        <value>some_color_from_color_xml</value>
</variable>

and then

Code:
<label>[COLOR=$VAR[FontColor]]someText[/COLOR] some more Text</label>

or

Code:
<textcolor>$VAR[FontColor]</textcolor>

does that answer your question?
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#5
Gotcha. Thanks.

Second thing I noticed- it seems that although labels support variables as textcolor, textboxes do not... or am I just going crazy?

A few things-

- using colordiffuse instead of images doesn't work. The <colordiffuse> attribute doesn't seem to allow $INFO, although it does allow $VAR.
- [COLOR] has to be explicit- no variables allowed.
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#6
(2014-09-14, 16:33)ZexisStryfe Wrote: - using colordiffuse instead of images doesn't work. The <colordiffuse> attribute doesn't seem to allow $INFO, although it does allow $VAR.
- [COLOR] has to be explicit- no variables allowed.

no, both works. I´m using it. Wink
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#7
(2014-09-14, 17:50)phil65 Wrote: no, both works. I´m using it. Wink

Hrm... what version are you running on? These doesn't seem to work for me and I am running 13.2. I have tried it in several places.

For example- this is the code for the layout

Code:
<control type="image">
   <left>5</left>
   <top>5</top>
   <width>133</width>
   <height>133</height>
   <texture>colors/color_white.png</texture>
</control>

Like this, I have white squares. If I add <colordiffuse>$INFO[ListItem.Label]</colordiffuse> I get no squares.

And for reference the items look like this-

Code:
<item id="2">
<!--green 1-->
   <onclick>Skin.SetString(accent.color,93ce5f)</onclick>
   <onclick>Close</onclick>
   <label>FF93ce5f</label>
</item>
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#8
I´m running 13.2.
try Container(xx).ListItem.Label if the image is not inside focused/itemlayout.

EDIT: youre right, that does not work inside lists. I only used it outside of the list.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#9
Well now I feel less crazy...

Now I just need to figure out what to do for my textboxes (in lists of course...).
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#10
(2014-09-15, 00:13)phil65 Wrote: I´m running 13.2.
try Container(xx).ListItem.Label if the image is not inside focused/itemlayout.

EDIT: youre right, that does not work inside lists. I only used it outside of the list.

Yep, doesn't work in lists. User set colours for home tiles was the primary reason why I needed to use a grouplist of buttons rather than a list container for the home menu in Eminence. It was a real pain to do....
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#11
It would be awesome if all these "quirks" with lists were resolved in Helix. Between this and the funky placement of center aligned labels it really is a pain in the butt...
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply
#12
Center alignment is fixed in Helix. Wink
Reply
#13
well, 50% there Wink
bit(ten) skin (Thread) (Project Site)
metroTV skin (Thread) (Project Site)

Reply

Logout Mark Read Team Forum Stats Members Help
Color Definitions0