BackgroundToForegroundConverter returning color may be changed in some accents? #2435

Closed
webwarrior06 opened this Issue Mar 18, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@webwarrior06

We are developing line of bussines application using MahApps with a small team. We compromised on BackgroundToForegroundConverter should return white color for good looking when lime and pink accent colors set. I made a graphic below about how GroupBox header looks in both cases. I want to get MahApps Community's opinion about this matter. Should this remain as it is or be replaced with the second one in the graphic?

What steps will reproduce this issue?

MahApps.Metro\Converters\BackgroundToForegroundConverter.cs:

private Color IdealTextColor(Color bg)
{
        const int nThreshold = 105;
        var bgDelta = System.Convert.ToInt32((bg.R * 0.299) + (bg.G * 0.587) + (bg.B * 0.114));
        var foreColor = (255 - bgDelta < nThreshold) ? Colors.Black : Colors.White;
        return foreColor;
}

treshold

Expected outcome

As I state before, we are in the opinion that the converter should return white color brush when Lime and Pink accents set.
In order to do this nThreshold constant should be set to 90. If this opinion will make sense for the community, I can make PR for this.

Environment

  • MahApps.Metro v1.3.0 Alpha 086
  • Windows 10 x64
  • Visual Studio 2015
  • .NET Framework 4.5.2

@webwarrior06 webwarrior06 changed the title from BackgroundToForegroundConverter return color may be changed in some accents? to BackgroundToForegroundConverter returning color may be changed in some accents? Mar 18, 2016

@punker76 punker76 added this to the 1.4.0 milestone Sep 20, 2016

@punker76 punker76 closed this in 703b830 Nov 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment