[solved] How Do I Get The Colours That I Want? (3 Viewers)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    No wonder you don't understand the damage your change can do!
    No damage will be. It will be as it is intended by the designer. Even if he spat on the fact that it does not work.
    If you break things it will be your own fault. Don't say I didn't warn you!
    I agree. But if you do not make mistakes, there will be no progress. All learn to their mistakes.

    PS: Waiting for the decision of @catavolt and @wizard123. :)
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    So do you intend to update the wiki as requested, or...?
    Yes, I will do this (or, at least, I will attempt it!). But not today.

    You know that MP only supports HEX colours... but other people do not. CyberSimian already thought # means HEX and no # means DECIMAL.
    I thought this because that was what the Wiki indicated in its examples. The solution is to correct the Wiki.

    Having thought about this, I find it hard to believe that any skin designer would want to specify colours in decimal. The hardware implementation is in the form of the colour mixing of three colour planes, A designer wanting to select a colour would pick the strength of each colour component. So he might specify a hexadecimal value such as 0x808080, or specify a decimal triplet (128,128,128), but he would not want to specify the single composite decimal value 8421504.

    I am not in favour of @ajs proposal to modify the code to accept colour values beginning with "#". There are unlikely to be many existing occurrences (I found none when I scanned "Ares", and only one when I scanned "DefaultWideHD" -- in "splashscreen.xml"). Also, what would this mean:

    Code:
    <colordiffuse>#ff404040</colordiffuse>

    You might think that it is obvious, but it is not so obvious if the designer has also coded:

    Code:
    <define>#ff404040:Please choose the option you that want</define>

    i.e. the designer has defined a variable with a name that looks like a valid colour value. So I think that the only change that should be implemented is to update the Wiki.

    -- from CyberSimian in the UK
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    i.e. the designer has defined a variable with a name that looks like a valid colour value.
    This does not affect the color, exactly as long as he does not specify this property as a color value. :)

    PS: I think this saying exactly determine the result of our discussion. :coffee::)
    Code:
    Scalded with milk, blows on the water.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    It will work with this value.
    That is an interesting statement, because it only works if prefixed with "#". If you remove the "#" (which is the conclusion reached by this thread), MP locks up and displays a pure white screen (at least, it does when using the "DefaultWideHD" splashscreen.xml on MP 1.12; I can't test MP 1.16 at the moment).

    I got this message in the MP error log:

    [2016-12-27 12:19:18,199] [Error ] [SplashScreen] [ERROR] - Error during splashscreen handling: 87cefa is not a valid value for Int32.

    Mysteries, mysteries...

    -- from CyberSimian in the UK
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    I got this message in the MP error log:
    Strangely, it should work as use function: c = (Color)TypeDescriptor.GetConverter(typeof(Color)).ConvertFromString(htmlColor);
    https://referencesource.microsoft.c...ystem/Drawing/Advanced/ColorTranslator.cs,275
    Perhaps this function will convert not all values. :(
    Try:
    XML:
    <textcolor>8900346</textcolor>


    Then, in splashscreen will always be work only:
    XML:
    <textcolor>#87cefa</textcolor>
    and
    XML:
    <textcolor>Blue</textcolor>
    :) ...
    But in skin, only:
    XML:
    <textcolor>87cefa</textcolor>
    and
    XML:
    <textcolor>Blue</textcolor>
    :)
     

    Users who are viewing this thread

    Top Bottom