forked from Kinnara/ModernWpf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccentColorPicker.xaml.cs
103 lines (96 loc) · 3.16 KB
/
AccentColorPicker.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
using ModernWpf;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace SamplesCommon
{
public partial class AccentColorPicker : UserControl
{
public AccentColorPicker()
{
InitializeComponent();
}
private void ResetAccentColor(object sender, RoutedEventArgs e)
{
DispatcherHelper.RunOnMainThread(() =>
{
ThemeManager.Current.AccentColor = null;
});
}
}
public class AccentColors : List<AccentColor>
{
public AccentColors()
{
Add("#FFB900", "Yellow gold");
Add("#FF8C00", "Gold");
Add("#F7630C", "Orange bright");
Add("#CA5010", "Orange dark");
Add("#DA3B01", "Rust");
Add("#EF6950", "Pale rust");
Add("#D13438", "Brick red");
Add("#FF4343", "Mod red");
Add("#E74856", "Pale red");
Add("#E81123", "Red");
Add("#EA005E", "Rose bright");
Add("#C30052", "Rose");
Add("#E3008C", "Plum light");
Add("#BF0077", "Plum");
Add("#C239B3", "Orchid light");
Add("#9A0089", "Orchid");
Add("#0078D7", "Default blue");
Add("#0063B1", "Navy blue");
Add("#8E8CD8", "Purple shadow");
Add("#6B69D6", "Purple shadow Dark");
Add("#8764B8", "Iris pastel");
Add("#744DA9", "Iris spring");
Add("#B146C2", "Violet red light");
Add("#881798", "Violet red");
Add("#0099BC", "Cool blue bright");
Add("#2D7D9A", "Cool blue");
Add("#00B7C3", "Seafoam");
Add("#038387", "Seafoam team");
Add("#00B294", "Mint light");
Add("#018574", "Mint dark");
Add("#00CC6A", "Turf green");
Add("#10893E", "Sport green");
Add("#7A7574", "Gray");
Add("#5D5A58", "Gray brown");
Add("#68768A", "Steel blue");
Add("#515C6B", "Metal blue");
Add("#567C73", "Pale moss");
Add("#486860", "Moss");
Add("#498205", "Meadow green");
Add("#107C10", "Green");
Add("#767676", "Overcast");
Add("#4C4A48", "Storm");
Add("#69797E", "Blue gray");
Add("#4A5459", "Gray dark");
Add("#647C64", "Liddy green");
Add("#525E54", "Sage");
Add("#847545", "Camouflage desert");
Add("#7E735F", "Camouflage");
}
private void Add(string color, string name)
{
Add(new AccentColor((Color)ColorConverter.ConvertFromString(color), name));
}
}
public class AccentColor
{
public AccentColor(Color color, string name)
{
Color = color;
Name = name;
Brush = new SolidColorBrush(color);
}
public Color Color { get; }
public string Name { get; }
public SolidColorBrush Brush { get; }
public override string ToString()
{
return Name;
}
}
}