os-win10.cpp
Go to the documentation of this file.
1 
2 #ifndef AVOID_WINRT_DEPENDENCY
3 #ifdef _MSC_VER
4 #include <winrt/Windows.UI.ViewManagement.h>
5 #endif
6 #endif
7 
8 extern "C" {
9 
10 bool
12 {
13 #ifndef AVOID_WINRT_DEPENDENCY
14 #ifdef _MSC_VER
15  using namespace winrt::Windows::UI::ViewManagement;
16  UISettings settings;
17  auto background = settings.GetColorValue(UIColorType::Background);
18  if (int(background.R) + int(background.G) + int(background.B) < 384) {
19  return true;
20  }
21 #endif
22 #endif
23  return false;
24 }
25 
26 bool
27 OSQueryAccentColour(int *r, int *g, int *b)
28 {
29 #ifndef AVOID_WINRT_DEPENDENCY
30 #ifdef _MSC_VER
31  using namespace winrt::Windows::UI::ViewManagement;
32  bool dark = OSReportsDarkThemeActive();
33  UISettings settings;
34  auto accent = settings.GetColorValue
35  (dark ? UIColorType::AccentLight1 : UIColorType::Accent);
36  *r = accent.R;
37  *g = accent.G;
38  *b = accent.B;
39  return true;
40 #endif
41 #endif
42  (void)r;
43  (void)g;
44  (void)b;
45  return false;
46 }
47 
48 }
49 
bool OSReportsDarkThemeActive()
Definition: os-win10.cpp:11
bool OSQueryAccentColour(int *r, int *g, int *b)
Definition: os-win10.cpp:27