[Proof Of Concept] Auto UI Colors
#1
As the subject says, this is entirely a proof of concept - posted in case it inspires others. Whilst I will probably take it through to be a useable script for my own skin (which will likely never be on the repo), I probably won't personally take it through to being a useable script for any skin on the repo. Having said that...

Fanart is a popular option with users, but it creates a problem for skinners - because the franart can be any color, it's difficult to create a UI which overlays on that image (whilst being translucent) and still allows the UI to be readable.

That set me working on a script which analyses the franart displayed (and, indeed, any playing video) and provides UI colors to display on top of it, as available here: https://github.com/unfledged/service.auto.ui.colors, and shown in these screenshots:

watch gallery


As said, it's a proof of concept rather than a useable script - if you were interested in adapting it for your own skin (and I'm sure others can come up with far better usages than I can!), you'd need to edit line 96 of service.py to recognise your skin, and use following $VAR's for your colors:

Gaze-Focused
Gaze-UnFocused
Gaze-Selected
Gaze-Complimentary (Overlay color)
Gaze-Complimentary2 (Alternative overlay color)

To be clear, the image used for generating the colors are based on

$INFO[ListItem.Art(fanart)
$INFO[Container(9002).ListItem.Art(fanart)] - My own skins home page widgets
Skin.String(backgroundColor)
Or the average color of the currently playing video.

(Edit: Just to try and belay any questions - ideally, the color would be based itself on a $VAR which, when set, would grab its value from a Skin.String or similar, or grab from a default value - but this lead to crashes (whilst testing on OS X) particularly when changing views from, for example, Home.xml to My*Nav.xml - so now grabs the image directly from the listitem.)

Hope this inspires someone Smile

(And to be clear, the biggest issue - Kodi can't assign label2 colors via a $VAR - so Settings*.xml, VideoOSDSettings.xml, and any other xml file which uses label2 can't use this method successfully.)
Reply
#2
Oooo thats pretty cool Smile
Reply
#3
Maybe I am not understanding what this does correctly, but what's the difference between this and the 13.3 point here :
http://wiki.xbmc.org/?title=XBMC_Skinning_Manual#Fanart

(= the last paragraph (4.3) here : http://wiki.xbmc.org/?title=FanArt#Skinn...for_FanArt )
Admin @ Passion-XBMC
(official french community)
Reply
#4
(2014-10-14, 16:30)Maxoo Wrote: Maybe I am not understanding what this does correctly, but what's the difference between this and the 13.3 point here :
http://wiki.xbmc.org/?title=XBMC_Skinning_Manual#Fanart

(= the last paragraph (4.3) here : http://wiki.xbmc.org/?title=FanArt#Skinn...for_FanArt )

the color infolabels you mentioned have to be scraped (and no scraper offers this afaik, so no skin uses them), the script of Unfledged pulls those values from the image itself.
@Unfledged did you have a look on CPU usage? Is it noticable?
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#5
That (I believe) only works for tv shows, only works when thetvdb has fanart color data, and has previously been suggested will be removed in upcoming versions.

This is an idea of an alternative method (that also works on movie fanart, music fanart and playing video), nothing more.

(2014-10-14, 16:35)phil65 Wrote: @Unfledged did you have a look on CPU usage? Is it noticable?

I've not done any profiling, so can only give my own impressions - And the best I can say is I have been using it on a rPi without any major issues for some weeks (watching something right now with cpu averaging around 45%), and there are plenty of areas where cpu usage could be improved.
Reply
#6
(2014-10-14, 16:37)Unfledged Wrote: I've not done any profiling, so can only give my own impressions - And the best I can say is I have been using it on a rPi without any major issues for some weeks (watching something right now with cpu averaging around 45%), and there are plenty of areas where cpu usage could be improved.
If it runs on rPi it runs on everything Big Grin
Reply
#7
Quote: 4.3 More About FanArt Colors

One fun aspect of FanArt support is that it is more than just an image. XBMC has support for FanArt themes which means the skin has the ability to completely adapt the current view to the image and the colors in the image. It can do this through the use of the three fanart color infolabels. When FanArt images are uploaded by a user to TheTVDB.com, they are asked to select three colors, or the system auto-generates three colors, which are designed to "go with" the image and provide a light highlight color, a dark highlight color, and a neutral matte color.
Either the wiki is wrong, or XBMC is already capable of extracting the 3 colors from the image.

(I genualy don't know which one is right, I'm just pointing out that there is a mistake somewhere)
Admin @ Passion-XBMC
(official french community)
Reply
#8
(2014-10-15, 19:05)Maxoo Wrote:
Quote: 4.3 More About FanArt Colors

One fun aspect of FanArt support is that it is more than just an image. XBMC has support for FanArt themes which means the skin has the ability to completely adapt the current view to the image and the colors in the image. It can do this through the use of the three fanart color infolabels. When FanArt images are uploaded by a user to TheTVDB.com, they are asked to select three colors, or the system auto-generates three colors, which are designed to "go with" the image and provide a light highlight color, a dark highlight color, and a neutral matte color.
Either the wiki is wrong, or XBMC is already capable of extracting the 3 colors from the image.

(I genualy don't know which one is right, I'm just pointing out that there is a mistake somewhere)

there was a time (maybe there still is) that tvdb provided the colours for the fanart
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#9
(2014-10-15, 19:05)Maxoo Wrote:
Quote: 4.3 More About FanArt Colors

One fun aspect of FanArt support is that it is more than just an image. XBMC has support for FanArt themes which means the skin has the ability to completely adapt the current view to the image and the colors in the image. It can do this through the use of the three fanart color infolabels. When FanArt images are uploaded by a user to TheTVDB.com, they are asked to select three colors, or the system auto-generates three colors, which are designed to "go with" the image and provide a light highlight color, a dark highlight color, and a neutral matte color.
Either the wiki is wrong, or XBMC is already capable of extracting the 3 colors from the image.

(I genualy don't know which one is right, I'm just pointing out that there is a mistake somewhere)

I believe that is stating that TheTVDB.com system generates the colors, not XBMC.
Reply
#10
nvm.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#11
(2014-10-15, 19:07)Martijn Wrote: there was a time (maybe there still is) that tvdb provided the colours for the fanart

Still does AFAIK, however, XBMC is not using it.
My skins:

Amber
Quartz

Reply
#12
Hey guys,I'm in the very very early process of writing a skin but I had this kind of feature in mind, but it seems that the OP removed the file from the link. Do someone happens to have it, or knows how can I get this similar effect. Specifically I'm developing (another) material design inspired skin and I would like to mimic the feature that the interface has which analises an image and can output the most predominant and/or a highlight color. Any help is welcome. Thanks
Reply
#13
This is the last version I have of it - though its been heavily modified to produce blurred images, most of the original color-grabbing code should be in there if you can navigate your way around python.
Reply
#14
I'll see what I can do. Nothing seems too difficult since starting a skin from scratch with 0% knowledge lol. Thank you very much.
Reply
#15
Maybe one of these Infolabels could be helpful:

Quote:Fanart.Color1 Returns the first of three colors included in the currently selected Fanart theme for the parent TV Show. Colors are arranged Lightest to Darkest.
Fanart.Color2 Returns the second of three colors included in the currently selected Fanart theme for the parent TV Show. Colors are arranged Lightest to Darkest.
Fanart.Color3 Returns the third of three colors included in the currently selected Fanart theme for the parent TV Show. Colors are arranged Lightest to Darkest.

EDIT: O.K., didnt recognise at the first quick view that these are only for TV-Shows /EDIT

However, imo. most dark or bright colors work on top of Fanarts (transparent).

If you would like to do it via script, you may still have to find a way to adjust the textcolor to. (maybe; - didnt test the Script, its just a guess)
Reply

Logout Mark Read Team Forum Stats Members Help
[Proof Of Concept] Auto UI Colors0