Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get UWP theme colors in C# code

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

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

I have seen XAML markup that references theme colors but would like to know the RGB value.

like image 718
holmis83 Avatar asked Feb 23 '16 09:02

holmis83


1 Answers

Take a look at XAML theme resources, and you can use

Application.Current.Resources["SystemAccentColor"]

like image 51
Haibara Ai Avatar answered Sep 20 '22 13:09

Haibara Ai