[solved] How Do I Get The Colours That I Want? (1 Viewer)

CyberSimian

Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    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:
    #00000000  Black
    #40ffffff  Black
    #50ffffff  Black
    #58ffffff  Black
    #5bffffff  Black
    #5dffffff  Black
    #5fffffff  Black
    #60ffffff  Darker grey
    #61ffffff  Black
    #80ffffff  Mid grey
    #a0ffffff  Black
    #c0ffffff  Black
    #e0ffffff  Black
    #ffffffff  White

    I also tried some other combinations, using #80 for the alpha channel (which produces mid grey when combined with #ffffff):

    Code:
    #ff000000  Black
    #80ff0000  Black
    #8000ff00  Black
    #800000ff  Black
    #80ff00ff  Black
    #8000ffff  Black
    #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
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    All colordiffuse must be without the #, e.g. <colordiffuse>90ffffff</colordiffuse>
    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:
    <!-- specify a named color with non-default alpha (using hex, preferred) -->
    <textcolor>White:#60</textcolor>
    <!-- not using hex -->
    <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
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,496
    10,374
    Kyiv
    Home Country
    Ukraine Ukraine
    From wiki:
    Code:
    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
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,368
    10,407
    Königstein (Taunus)
    Home Country
    Germany Germany
    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:
    XML:
    <control>
            <description>Video codec</description>
            <type>image</type>
            <id>0</id>
            <width>102</width>
            <height>70</height>
            <texture>Logos\video\#Play.Current.VideoCodec.Texture.png</texture>
            <keepaspectratio>yes</keepaspectratio>
            <colordiffuse>gold</colordiffuse>
          </control>
    As you see I coloured the original white logos to gold - screenshot:
    12-54-53.jpg
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    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
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,368
    10,407
    Königstein (Taunus)
    Home Country
    Germany Germany
    Ah, forget this one: I often use a black background for darken some areas of the screen
    @catavolt have you tried using cbffffff on one of the panels where you currently use ccffffff? What result do you get?
    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 ;)
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    I think the difference between cc and cb for the alpha channel is so marginal that it won´t be seen clearly ;)
    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
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,368
    10,407
    Königstein (Taunus)
    Home Country
    Germany Germany
    Now that seems strange then ;)
    I´ll do some tests later the day with those values and report back ;)
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    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.
     

    Users who are viewing this thread

    Top Bottom