在 C# 代码中获取 UWP 主题颜色

Get UWP theme colors in C# code

是否可以使用 C# 代码在 UWP 应用程序中获取当前 Windows 10 种主​​题颜色?

我找到了 Application.RequestedTheme property 但它只告诉我是否使用了深色 och 浅色主题,而不是实际颜色。

我看到 XAML 引用主题颜色的标记,但想知道 RGB 值。

看看XAML theme resources,你可以用

Application.Current.Resources["SystemAccentColor"]