TV Guide : Obtaining the genre colour (1 Viewer)

Rob Hexenmeister

MP Donator
  • Premium Supporter
  • May 12, 2011
    238
    58
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    Good afternoon,

    Does anyone know a way of referencing the genre colour of the currently selected item in the TV Guide. We are all familiar with #TV.Guide.Genre in the properties, but I can't find a way of getting hold of the colour, which I want to use as a highlight (colordiffuse) on some of my labels.

    I've looked through the PropertyManager.cs and the skin settings, and can find nothing other than the <tvguidecolors> table (genre0, genre1 etc) from which I would not know how to extract the relevant colour from for the currently selected item.

    Any ideas?

    Many thanks
    RH
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    3,028
    1,894
    Southampton
    Home Country
    United Kingdom United Kingdom
    Does anyone know a way of referencing the genre colour of the currently selected item in the TV Guide.
    If there were a built-in skin variable called #TV.Guide.GenreColor, you would have your solution. Unfortunately, no such skin variable exists, and I cannot think of any way of obtaining the genre colour by a different method. :(

    It would need one of the developers to add this skin variable, but time is precious and it may take too much time to understand the code in order to find the right place to add the definition. :(

    -- from CyberSimian in the UK
     

    High_Five

    Design Group
  • Team MediaPortal
  • February 10, 2023
    71
    372
    Home Country
    Germany Germany
    I think you can find all the necessary information on how to map MediaPortal genre names to program genre names and assign the desired colors to the MP genres in the wiki on the topic “Skin Tv Guide” at
    Skin TV Guide.
    In this chapter you will also discover the hexadecimal color codes for the MP genres used (see image), which you will need to color your labels. ;)

    Farbbild.jpg
     

    Rob Hexenmeister

    MP Donator
  • Premium Supporter
  • May 12, 2011
    238
    58
    Slaithwaite
    Home Country
    United Kingdom United Kingdom
    I think you can find all the necessary information on how to map MediaPortal genre names to program genre names and assign the desired colors to the MP genres in the wiki on the topic “Skin Tv Guide” at
    Skin TV Guide.
    In this chapter you will also discover the hexadecimal color codes for the MP genres used (see image), which you will need to color your labels. ;)

    View attachment 215755

    Yes, thanks High_Five, I know how to do that, but that is not what I am trying to do. CyberSimian has got it.

    I am trying to retrieve the colour of the selected cell on the TV guide, which I then want to use in other controls on the page.

    At the moment, the only way I can see of doing it is to hard code it into the skin files, and use defines, basically cribbing the tvguidecolors from the SkinSettings.xml


    at the start of the mytvguide.xml

    <define>#gc.kids:FF807E00</define>

    then later...

    <control>
    ...
    ...
    <visible>string.contains(#TV.Guide.Genre,children)</visible>
    <colordiffuse>#gc.kids</colordiffuse>
    ....
    ....

    and so on for each genre


    What would have been better instead of defining each genre colour and duplicating all the controls would have been to have the colour of the currently selected programme genre in the guide returned in a variable such as #TV.Guide.Genrecolour

    Many thanks
     

    High_Five

    Design Group
  • Team MediaPortal
  • February 10, 2023
    71
    372
    Home Country
    Germany Germany
    Well, I had already recognized your problem, but I still wanted to point out the basic connections once again. Unfortunately, I don't have a fundamentally different solution for you, but with this approach you should achieve your goal. ;)
    The idea of first setting the current genre colors with the defines is certainly a good one, as it avoids confusing the hexadecimal color codes. Instead of repeating the controls for the individual genre elements, you could perhaps reduce your workload by using suitable skin logic. Instead of <colordiffuse> you could perhaps work better with <textcolor>, depending on the source color. In any case, good luck with your project and maybe you can post a screenshot when you're done! ;)
     

    Users who are viewing this thread


    Write your reply...
    Top Bottom