Get UWP theme colors in C # code

Is it possible to get the current colors of a Windows 10 theme in a UWP application with C # code?

I found the Application.RequestedTheme property , but it only tells me that the dark och light theme is used, not the actual colors.

I saw XAML markup that references theme colors, but would like to know the value of RGB.

+4
source share
1 answer

Check out the XAML theme resources and you can use

Application.Current.Resources["SystemAccentColor"]

+6
source

Source: https://habr.com/ru/post/1630030/


All Articles