-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ColorSchemes.cs
94 lines (86 loc) · 4.83 KB
/
ColorSchemes.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
using System;
using Windows.ApplicationModel.Core;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
namespace PassDefend
{
class ColorSchemes
{
public static SolidColorBrush GetSolidColorBrush(string hex)
{
hex = hex.Replace("#", string.Empty);
byte a = (byte)(Convert.ToUInt32(hex.Substring(0, 2), 16));
byte r = (byte)(Convert.ToUInt32(hex.Substring(2, 2), 16));
byte g = (byte)(Convert.ToUInt32(hex.Substring(4, 2), 16));
byte b = (byte)(Convert.ToUInt32(hex.Substring(6, 2), 16));
SolidColorBrush myBrush = new SolidColorBrush(Windows.UI.Color.FromArgb(a, r, g, b));
return myBrush;
}
public static void ModifyTitleBar(string colorValue, CoreApplicationViewTitleBar coreTitleBar)
{
//set colour for title bar
var color = GetSolidColorBrush(colorValue).Color;
//customise the title bar
coreTitleBar.ExtendViewIntoTitleBar = true;
//customise the exit, minimize and maximize buttons
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.BackgroundColor = color;
titleBar.ButtonBackgroundColor = color;
titleBar.ForegroundColor = Colors.White;
titleBar.ButtonForegroundColor = Colors.White;
titleBar.ButtonInactiveBackgroundColor = color;
titleBar.ButtonInactiveForegroundColor = Colors.White;
}
public static void Green(Grid AccountDetailWindow, Rectangle MainBackground , Grid OptionBar, Grid StatusBar, Grid SideBar, ListView accountList, Rectangle loginRectangle)
{
AccountDetailWindow.Background = GetSolidColorBrush("FF165D43");
MainBackground.Fill = GetSolidColorBrush("FF165D43");
OptionBar.Background = GetSolidColorBrush("FF19664A");
StatusBar.Background = GetSolidColorBrush("FF1E7957");
SideBar.Background = GetSolidColorBrush("FF26956C");
accountList.Background = GetSolidColorBrush("FF739E8E");
loginRectangle.Fill = GetSolidColorBrush("FF165D43");
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
ModifyTitleBar("FF165D43", coreTitleBar);
}
public static void Red(Grid AccountDetailWindow, Rectangle MainBackground , Grid OptionBar, Grid StatusBar, Grid SideBar, ListView accountList, Rectangle loginRectangle)
{
AccountDetailWindow.Background = GetSolidColorBrush("FF5D1616");
MainBackground.Fill = GetSolidColorBrush("FF5D1616");
OptionBar.Background = GetSolidColorBrush("FF802020");
StatusBar.Background = GetSolidColorBrush("FF952626");
SideBar.Background = GetSolidColorBrush("FF952626");
accountList.Background = GetSolidColorBrush("FF9E7373");
loginRectangle.Fill = GetSolidColorBrush("FF5D1616");
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
ModifyTitleBar("FF5D1616", coreTitleBar);
}
public static void Purple(Grid AccountDetailWindow, Rectangle MainBackground , Grid OptionBar, Grid StatusBar, Grid SideBar, ListView accountList, Rectangle loginRectangle)
{
AccountDetailWindow.Background = GetSolidColorBrush("FF40165D");
MainBackground.Fill = GetSolidColorBrush("FF40165D");
OptionBar.Background = GetSolidColorBrush("FF4C2080");
StatusBar.Background = GetSolidColorBrush("FF6D2695");
SideBar.Background = GetSolidColorBrush("FF6D2695");
accountList.Background = GetSolidColorBrush("FF81739E");
loginRectangle.Fill = GetSolidColorBrush("FF40165D");
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
ModifyTitleBar("FF40165D", coreTitleBar);
}
public static void Black(Grid AccountDetailWindow, Rectangle MainBackground , Grid OptionBar, Grid StatusBar, Grid SideBar, ListView accountList, Rectangle loginRectangle)
{
AccountDetailWindow.Background = GetSolidColorBrush("FF1B1B1B");
MainBackground.Fill = GetSolidColorBrush("FF1B1B1B");
OptionBar.Background = GetSolidColorBrush("FF171717");
StatusBar.Background = GetSolidColorBrush("FF0F0F0F");
SideBar.Background = GetSolidColorBrush("FF0F0F0F");
accountList.Background = GetSolidColorBrush("FF2E2E2E");
loginRectangle.Fill = GetSolidColorBrush("FF1B1B1B");
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
ModifyTitleBar("FF1B1B1B", coreTitleBar);
}
}
}