SearchWindow.xaml.cs
/// <summary>
/// Determines the alternative (more brighter) Windows accent brush. The accent will be made about 60% brighter.
/// </summary>
Determines the alternative (more brighter) Windows accent brush. The accent will be made about 60% brighter.
Determines the alternative ( more brighter ) Windows accent brush . The accent will be made about 60% brighter .
private void DetermineAlternativeAccentBrush()
        {
            try
            {
                var currentAccent = SystemParameters.WindowGlassColor;
                if (currentAccent != null)
                {
                    float correctionFactor = 0.8f;
                    float red = (255 - currentAccent.R) * correctionFactor + currentAccent.R;
                    float green = (255 - currentAccent.G) * correctionFactor + currentAccent.G;
                    float blue = (255 - currentAccent.B) * correctionFactor + currentAccent.B;
                    Color lighterAccent = Color.FromArgb(currentAccent.A, (byte)red, (byte)green, (byte)blue);
                    this.AlternativeAccentBrush = new SolidColorBrush(lighterAccent);
                }
                else
                {
                    this.AlternativeAccentBrush = new SolidColorBrush(currentAccent);
                }
            }
            catch(Exception ex)
            {
                Utility.Current.HandleException(ex);
            }
        }
private void DetermineAlternativeAccentBrush ( ) { try { var currentAccent = SystemParameters . WindowGlassColor ; if ( currentAccent != null ) { float correctionFactor = 0.8f ; float red = ( 255 - currentAccent . R ) * correctionFactor + currentAccent . R ; float green = ( 255 - currentAccent . G ) * correctionFactor + currentAccent . G ; float blue = ( 255 - currentAccent . B ) * correctionFactor + currentAccent . B ; Color lighterAccent = Color . FromArgb ( currentAccent . A , ( byte ) red , ( byte ) green , ( byte ) blue ) ; this . AlternativeAccentBrush = new SolidColorBrush ( lighterAccent ) ; } else { this . AlternativeAccentBrush = new SolidColorBrush ( currentAccent ) ; } } catch ( Exception ex ) { Utility . Current . HandleException ( ex ) ; } }
Determines the alternative (more brighter) Windows accent brush.
Determines the alternative ( more brighter ) Windows accent brush .