Skip to content

Commit c138495

Browse files
committed
Added missing colors
1 parent 5d527f1 commit c138495

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

src/Codebreaker.WinUI/Converters/ColornameToBrushConverter.cs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.UI;
1+
using Microsoft.Extensions.Logging;
2+
using Microsoft.UI;
23
using Microsoft.UI.Xaml.Data;
34
using Microsoft.UI.Xaml.Media;
45
using Windows.UI;
@@ -11,18 +12,12 @@ public class ColornameToBrushConverter : IValueConverter
1112
private readonly static Brush s_whiteBrush = new SolidColorBrush(Colors.White);
1213
private readonly static Brush s_redBrush = new SolidColorBrush(Color.FromArgb(255, 209, 52, 56));
1314
private readonly static Brush s_greenBrush = new SolidColorBrush(Color.FromArgb(255, 0, 173, 86));
14-
private readonly static Brush s_blueBrush = new SolidColorBrush(Color.FromArgb(255, 79, 107, 237));
15+
private readonly static Brush s_blueBrush = new SolidColorBrush(Color.FromArgb(255, 0, 128, 212));
1516
private readonly static Brush s_yellowBrush = new SolidColorBrush(Color.FromArgb(255, 252, 225, 0));
17+
private readonly static Brush s_orangeBrush = new SolidColorBrush(Color.FromArgb(255, 234, 74, 33));
18+
private readonly static Brush s_purpleBrush = new SolidColorBrush(Color.FromArgb(255, 91, 95, 199));
1619
private readonly static Brush s_emptyBrush = new SolidColorBrush(Color.FromArgb(255, 160, 174, 178));
1720

18-
public Brush BlackBrush { get; set; } = s_blackBrush;
19-
public Brush WhiteBrush { get; set; } = s_whiteBrush;
20-
public Brush RedBrush { get; set; } = s_redBrush;
21-
public Brush GreenBrush { get; set; } = s_greenBrush;
22-
public Brush BlueBrush { get; set; } = s_blueBrush;
23-
public Brush YellowBrush { get; set; } = s_yellowBrush;
24-
private Brush EmptyBrush { get; set; } = s_emptyBrush;
25-
2621
public object Convert(object value, Type targetType, object parameter, string language)
2722
{
2823
if (value is null)
@@ -33,13 +28,15 @@ public object Convert(object value, Type targetType, object parameter, string la
3328

3429
return colorname switch
3530
{
36-
"Black" => BlackBrush,
37-
"White" => WhiteBrush,
38-
"Red" => RedBrush,
39-
"Green" => GreenBrush,
40-
"Blue" => BlueBrush,
41-
"Yellow" => YellowBrush,
42-
_ => EmptyBrush
31+
"Black" => s_blackBrush,
32+
"White" => s_whiteBrush,
33+
"Red" => s_redBrush,
34+
"Green" => s_greenBrush,
35+
"Blue" => s_blueBrush,
36+
"Yellow" => s_yellowBrush,
37+
"Orange" => s_orangeBrush,
38+
"Purple" => s_purpleBrush,
39+
_ => s_emptyBrush
4340
};
4441
}
4542

0 commit comments

Comments
 (0)