[solved] - How Do I Get The Colours That I Want?

Discussion in 'MediaPortal 1 Skins' started by CyberSimian, December 26, 2016.

Loading...
  1. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,638
    Likes Received:
    541
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +961 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Recently I have been making a few changes to the skin that I use. I have re-arranged some of the data on the screen, and that works OK. But I cannot get the skin engine to display the colours that I want. :cry: The skin ("DefaultWide" in MP 1.12) uses picture backgrounds, which I find make the text more difficult to read. So I want to replace those by plain coloured backgrounds. This is what I have done:



    (1) I replaced the background image "background.png" with "white.png". I have looked at the latter in "Photoshop", and it is a tri-colour image with all of the colour planes set to "255".

    (2) I commented out various overlays that seemed to produce non-uniform backgrounds (e.g. darker central band, with lighter bands at the top and bottom of the panel).

    (3) I tried various values for the COLORDIFFUSE attribute. But virtually all values result in a black background. :confused: These are the values that I tried and the colour of the background that results:
    Code (Text):
    1. #00000000  Black
    2. #40ffffff  Black
    3. #50ffffff  Black
    4. #58ffffff  Black
    5. #5bffffff  Black
    6. #5dffffff  Black
    7. #5fffffff  Black
    8. #60ffffff  Darker grey
    9. #61ffffff  Black
    10. #80ffffff  Mid grey
    11. #a0ffffff  Black
    12. #c0ffffff  Black
    13. #e0ffffff  Black
    14. #ffffffff  White
    I also tried some other combinations, using #80 for the alpha channel (which produces mid grey when combined with #ffffff):

    Code (Text):
    1. #ff000000  Black
    2. #80ff0000  Black
    3. #8000ff00  Black
    4. #800000ff  Black
    5. #80ff00ff  Black
    6. #8000ffff  Black
    7. #80ffff00  Black
    So, how do I get this to work? I want to be able to choose from any of the 2**24 possible colours (256 x 256 x 256). Do I need to use "black.png", or possibly a second image to act as an overlay? The behaviour that I have found so far is completely puzzling. :confused: Thanks for any help.

    -- from CyberSimian in the UK
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Threadmarks: Solution
    catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,234
    Likes Received:
    4,980
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,390 / 38
    Home Country:
    Germany Germany
    Show System Specs
    All colordiffuse must be without the #, e.g. <colordiffuse>90ffffff</colordiffuse> ;)
    If you use a white.png, you may colourize it with any colour like e.g. <colordiffuse>90372268</colordiffuse> ;)
     
    • Thank You! Thank You! x 1
    • Informative Informative x 1
  4. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,638
    Likes Received:
    541
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +961 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Well, this is very strange. This page in the Wiki:

    https://www.team-mediaportal.com/wiki/display/MediaPortal1/Colors

    shows that numbers prefixed with "#" are valid for the TEXTCOLOR attribute. Are you saying that COLORDIFFUSE is different from TEXTCOLOR in this respect?

    I have just been experimenting, and I can now get some colours, but only by using values that do not contain hexadecimal digits Example: various combinations of "9" work (99999999, 99009999, 99990099, ...).

    The Wiki page above seems to suggest that numbers not prefixed with "#" are treated as decimal numbers, and not hexadecimal. It gives the following examples:

    Code (Text):
    1. <!-- specify a named color with non-default alpha (using hex, preferred) -->
    2. <textcolor>White:#60</textcolor>
    3. <!-- not using hex -->
    4. <textcolor>White:96</textcolor>

    I have just scanned the skin files for "DefaultWideHD" (MP 1.16 pre), and I see that there are lots of uses of hexadecimal digits. So I tried a value that you use: I specified "#ccffffff" (without the quotes). That gave a light grey background, but the adjacent value "#cbffffff" gave a black background. I also tried the same values without the leading "#"; they gave the same result ("ccffffff" worked, "cbffffff" did not).

    So, I am still puzzled. What exactly does COLORDIFFUSE accept:

    (1) Only decimal values.
    (2) Only hexadecimal values that do not contain hexadecimal digits.
    (3) Something else.

    -- from CyberSimian in the UK
     
  5. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,620
    Likes Received:
    2,652
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,603 / 29
    Home Country:
    Ukraine Ukraine
    Show System Specs
    From wiki:
    Code (Text):
    1. Allows you to mix a color & a graphics texture. E.g. If you have a graphics texture like a blue button you can mix it with a yellow color diffuse and the end result will be green. Defaults to 0xFFFFFFFF
     
  6. catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,234
    Likes Received:
    4,980
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,390 / 38
    Home Country:
    Germany Germany
    Show System Specs
    Hex values or even standard colour names like e.g. lightskyblue, gold, red ;) And without the # ;)
    And it works everywhere:
    This is an excerpt from the medialogos display in TV OSD in PureVisionHD XMAS skin:
    Code (XML):
    1. <control>
    2.         <description>Video codec</description>
    3.         <type>image</type>
    4.         <id>0</id>
    5.         <width>102</width>
    6.         <height>70</height>
    7.         <texture>Logos\video\#Play.Current.VideoCodec.Texture.png</texture>
    8.         <keepaspectratio>yes</keepaspectratio>
    9.         <colordiffuse>gold</colordiffuse>
    10.       </control>
    As you see I coloured the original white logos to gold - screenshot:
    12-54-53.jpg
     
    • Informative Informative x 1
  7. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,638
    Likes Received:
    541
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +961 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Well, I am still puzzled. :confused: "DefaultWideHD" seems to use most often a doubled hex digit for the alpha channel. So I have just tried these values:
    ffffffff, eeffffff, ddffffff, ..., 44ffffff, 33ffffff, 22ffffff, 11ffffff, 00ffffff
    They all looked correct except for 33, 22, and 11. These looked like black, but that may be caused by the response of my TV screen at low levels.

    Then I tried single colours:
    ff0000ff, ee0000ff, dd0000ff, ...
    ff00ff00, ee00ff00, dd00ff00, ...
    ffff0000, eeff0000, ddff0000, ...
    These all worked correctly, including the 33, 22, and 11 levels. These were very faint, but the background was clearly tinted red, green, or blue (as appropriate).

    Then I tried again: ccffffff -- that worked (light grey background). But cbffffff still did not work (gives a black background). Then I tried the single colours: cb0000ff, cb00ff00, cbff0000. These all worked. But cbffffff still does not work!

    @catavolt have you tried using cbffffff on one of the panels where you currently use ccffffff? What result do you get?

    -- from CyberSimian, flummoxed in the UK
     
  8. catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,234
    Likes Received:
    4,980
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,390 / 38
    Home Country:
    Germany Germany
    Show System Specs
    Ah, forget this one: I often use a black background for darken some areas of the screen
    I think the difference between cc and cb for the alpha channel is so marginal that it won´t be seen clearly ;)
    But this is only a guess - and as you wrote above something about your tv settings, this may also cause those effects you see ;)
    Also the GFX card setting for full colours may affect what you see ;)
     
  9. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,638
    Likes Received:
    541
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +961 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Yes, I agree with that, but that is not the result that I am getting:

    ccffffff -- Light grey background
    cbffffff -- BLACK background

    -- from CyberSimian in the UK
     
    • Like Like x 1
  10. catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,234
    Likes Received:
    4,980
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,390 / 38
    Home Country:
    Germany Germany
    Show System Specs
    Now that seems strange then ;)
    I´ll do some tests later the day with those values and report back ;)
     
  11. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,735
    Ratings:
    +8,201 / 17
    Home Country:
    New Zealand New Zealand
    The relevant code:
    https://github.com/MediaPortal/Medi...aportal/Core/guilib/GUIControlFactory.cs#L259

    On reading the code you will see that the value will be interpreted as a named colour (eg. "gold") if the value contains any characters outside 0-9A-Fa-f. That's exactly what's going to happen if you include a # prefix. Therefore catavolt's advice to not include the prefix is good.

    Note the "GUIControlFactory.ConvertXmlStringToObject: Invalid color format '#{0}' reverting to White" log entry. Please check your log files for those.
     
    • Like Like x 1
Loading...
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!