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

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,637
    Likes Received:
    540
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +960 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Well, I have eliminated all use of the "#" in colours (mostly, but not entirely, in code that I had added or modified), and... it now all works as expected. :) :) :)

    Thanks, guys.

    -- from CyberSimian in the UK


     
    • Like Like x 2
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. 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
    Let use, they are in the case of source code changes will have the color of which was conceived by the author rather than the default color.

    Nothing will happen, because if the author thought of color #FFCCDDAA, he will receive it and, rather than an error in the log file and the default color.
     
  4. Threadmarks: Solution for color with # in textcolor, colorkey, colordiffuse (Not done)
    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
    Here it is a small change will not affect the skins work, and will work just as described in the wiki.
    https://github.com/MediaPortal/Medi...al/Core/guilib/GUIControlFactory.cs#L265-L278
    Code (C#):
    1.             if (valueText.Length > 0)
    2.             {
    3.               bool isNamedColor = false;
    4.               bool isSharp = false;
    5.  
    6.               if (valueText[0] == '#' && valueText.Length > 1)
    7.               {
    8.                 valueText = valueText.Substring(1);
    9.                 isSharp = true;
    10.               }
    11.  
    12.               foreach (char ch in valueText)
    13.               {
    14.                 if (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f')
    15.                 {
    16.                   continue;
    17.                 }
    18.  
    19.                 isNamedColor = true;
    20.                 break;
    21.               }
    22.  
    23.               if (isNamedColor && isSharp) // Property
    24.               {
    25.                 valueText = "#" + valueText;
    26.               }
    Then the color specified in the skins as #AARRGGBB, AARRGGBB operate the same.

    @CyberSimian @catavolt
    Make JIRA Ticket? Make Corrections? :whistle::coffee:

    In MP Wiki, Color can have a value:
    • Hex values in the format #RRGGBB
    • Hex values in the format #AARRGGBB
    • Named colors
    No decimal, only hexadecimal for non named color ... :)
     
    Last edited: December 27, 2016
    • Thank You! Thank You! x 1
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,734
    Ratings:
    +8,200 / 17
    Home Country:
    New Zealand New Zealand
    Great.
    So do you intend to update the wiki as requested, or...?

    Sorry, I will not support this change because:
    1. It may change colouring for existing skins in unexpected ways. If the skin designer previously used #AARRGGBB, that does not guarantee that they wanted the AARRGGBB colour. If they had wanted the AARRGGBB colour, they should have noticed that #AARRGGBB gave them black instead of AARRGGBB and fixed it.
    2. In the existing colour handling, # in a named colour (eg. "White:#60") means "hexadecimal" and no # in a named colour (eg. "White:60") means decimal. Supporting a # prefix for any colour is confusing because it doesn't match the existing hexadecimal meaning.
    3. In the wider skin engine, a # prefix is a define. Adding a # prefix for colours could introduce unexpected bugs.
     
    • Like Like x 1
  6. 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
    Why not? If I want a green apple, green apple I take, and I do not take the yellow lemon. If a designer wanted #AARRGGBB, he watched the color table, and knew what he wanted. If he had turned a different color then it would open a topic about it, as did @CyberSimian.
    Nothing changes:
    • White:#60 = White with HEX alpha = #60
    • White:60 = White with Decimal alpha = 60
    • AARRGGBB = HTML Color = AARRGGBB
    • #AARRGGBB = HTML Color = AARRGGBB
    • RRGGBB = HTML Color = RRGGBB
    • #RRGGBB = HTML Color = RRGGBB
    How not? Media portal only supports hexadecimal color, and only in the alpha channel for a named colors supports both formats.
    The procedure is not processing this symbol, if the system is able to determine the standard color, or if the color is in the cache, then we get what we wanted, or we'll get the default color that is white. But if you make the changes, then we will get the color as described in the wiki. Note the color value is not provided by the property.This is evident from the source code.
     
    • Thank You! Thank You! x 1
  7. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,734
    Ratings:
    +8,200 / 17
    Home Country:
    New Zealand New Zealand
    I already explained! o_O

    If I give you a yellow lemon when you ask for a green apple, I will assume that the yellow lemon is okay if you don't complain. You should have complained if the green apple was really important.

    Yes, I agree... but if the skin engine gives the designer black instead of AARRGGBB and the designer does not complain, the designer must think that black is okay too. Now after X years the designer and people who use the designer's skin expect black. If you change the black to AARRGGBB, the designer and users will be angry with you. It's much easier to fix the wiki and say that #AARRGGBB is not a valid colour value. That way the skin engine will stay the same and nobody will be angry.

    Of course something changes!
    Now #AARRGGBB gives black.
    After your change, #AARRGGBB will give AARRGGBB.

    You know that MP only supports HEX colours... but other people do not. CyberSimian already thought # means HEX and no # means DECIMAL. If you add support for #AARRGGBB, even more people will be confused.

    But other earlier procedures do! # means skin engine defined value (eg. BasicHome.xml: <define>#selecteditem:</define> etc.):
    https://github.com/MediaPortal/Medi...al/Core/guilib/GUIControlFactory.cs#L556-L571

    Please, let's just leave the code alone! There's no need to add support for #AARRGGBB.
     
    • Agree Agree x 1
  8. 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
    White, not Black - return Color.White.ToArgb(); :whistle::coffee:
    Since no one complains, then all got a green apple. In addition to @CyberSimian , he is complaining. :)
    Designer, replace the #AARRGGBB on White, it is not difficult. The more so because the designer does not always get the white, it is in the case of falling into the standard colors to get the color he wanted.
    Color.FromName("#AARRGGBB") - In some cases, it is working.
    White or AARRGGBB ... :) Why is described above.
    If they read the documentation that is written in it all.
    This is another property. It does not refer to the color.
    I also said when I made corrections to the FH, LMH, if I did not correct these plug-ins are not sure that they would work. The same is true about MP1-4715. MP1-4831 etc.
    PS: https://forum.team-mediaportal.com/...-front-of-programs.135619/page-2#post-1205397 :whistle::coffee:
     
    • Thank You! Thank You! x 1
    • Disagree Disagree x 1
  9. 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
    I think it is to solve the designers. I can make these changes. And we can check. What is and what is not broken. I can not do. Solution for @Designers.
     
  10. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,734
    Ratings:
    +8,200 / 17
    Home Country:
    New Zealand New Zealand
    Black, not white!

    Code (Text):
    1. return colCache.TryGetOrAdd(valueText, col => Color.FromName(valueText)).ToArgb();
    Color.FromName("#[AARRGGBB]").ToArgb() == 0 == BLACK

    This code will never be reached in the case of #AARRGGBB. isNamedColor must be true because of the #. Try it and you will see.


    It seems that you don't actually understand the code properly. No wonder you don't understand the damage your change can do!

    I've spend enough time (hours!) understanding the code and explaining to you and CyberSimian. You have my advice. I'm not going to waste any more time. If you break things it will be your own fault. Don't say I didn't warn you!
     
  11. wizard123
    • Team MediaPortal

    wizard123 Design Group

    Joined:
    January 24, 2012
    Messages:
    2,499
    Likes Received:
    1,695
    Gender:
    Male
    Occupation:
    genius
    Ratings:
    +2,919 / 11
    Home Country:
    United Kingdom United Kingdom
    Indeed some do i have seen it many times before over the years.
     
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!