Overriding Accent Color in Windows 10 IoT
While working on an project using Windows 10 on a Raspberry Pi 2 I found that on that device the defualt system color seems to be set to “HotPink.”
This causes any control with an accent color (basically all) to be pink as well.
The problem seemed specific to the Windows 10 IoT Core version and respected the user selected system colors when running on any other Windows 10 device.
After some Googling, I found Adam Kinney had pointed out a solution. Unfortunately this only changed the accent color.
This fixed the issue on toggleSwitches but still showed the ‘HotPink’ accent color on other controls and in hover states.
After finding no additional guidance online I combed through the Windows 10 kit’s generic.xaml line by line.
Turns out only two additional lines were missing from Adam’s solution to get this to work for me:
<Application> <Application.Resources> <SolidColorBrush x:Key="SystemControlHighlightAccentBrush">#ff1BA1E2</SolidColorBrush> <!-- The two following lines set the hover and foreground colors --> <SolidColorBrush x:Key="SystemControlHighlightListAccentHighBrush">#FF006AC1</SolidColorBrush> <SolidColorBrush x:Key="SystemControlForegroundAccentBrush">#ff1BA1E2</SolidColorBrush> </Application.Resources> </Application>
Just place the code in your App.xaml or if you want specific color controls on all apps you can always replace these lines in the generic.xaml file.