Skip to content

Commit c929d12

Browse files
committed
coding standards
1 parent c865eb7 commit c929d12

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

MaterialDesignThemes.Wpf/Converters/BrushRoundConverter.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace MaterialDesignThemes.Wpf.Converters
88
{
99
public class BrushRoundConverter : IValueConverter
1010
{
11-
public Brush UpValue { get; set; } = Brushes.White;
11+
public Brush HighValue { get; set; } = Brushes.White;
1212

1313
public Brush LowValue { get; set; } = Brushes.Black;
1414

@@ -17,11 +17,12 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
1717
var solidColorBrush = value as SolidColorBrush;
1818
if (solidColorBrush == null) return Binding.DoNothing;
1919

20-
Color color = solidColorBrush.Color;
2120

22-
double brightness = 0.3 * color.R + 0.59 * color.G + 0.11 * color.B;
21+
var color = solidColorBrush.Color;
2322

24-
return brightness < 123 ? LowValue : UpValue;
23+
var brightness = 0.3 * color.R + 0.59 * color.G + 0.11 * color.B;
24+
25+
return brightness < 123 ? LowValue : HighValue;
2526
}
2627

2728
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

0 commit comments

Comments
 (0)