@@ -20,8 +20,7 @@ internal sealed class SystemAccentColors : ResourceProvider
2020 private static readonly Color s_defaultSystemAccentColor = Color . FromRgb ( 0 , 120 , 215 ) ;
2121 // Static shade values from WinUI (matching the Uno/WinUI SystemResources defaults). Used when
2222 // the platform provides no accent color, so the out-of-the-box palette matches WinUI exactly.
23- // When the platform reports the OS-computed shades (Windows does, via UISettings) those are
24- // used verbatim; otherwise an OS-provided base accent gets HSL-computed shades.
23+ // OS-provided accent colors get computed shades instead.
2524 private static readonly Color s_defaultSystemAccentColorDark1 = Color . FromUInt32 ( 0xFF005A9E ) ;
2625 private static readonly Color s_defaultSystemAccentColorDark2 = Color . FromUInt32 ( 0xFF004275 ) ;
2726 private static readonly Color s_defaultSystemAccentColorDark3 = Color . FromUInt32 ( 0xFF002642 ) ;
@@ -118,22 +117,11 @@ private void EnsureColors()
118117 {
119118 _invalidateColors = false ;
120119
121- var colorValues = GetFromOwner ( Owner ) ? . GetColorValues ( ) ;
120+ var platformSettings = GetFromOwner ( Owner ) ;
122121
123- _systemAccentColor = colorValues ? . AccentColor1 ?? s_defaultSystemAccentColor ;
122+ _systemAccentColor = platformSettings ? . GetColorValues ( ) . AccentColor1 ?? s_defaultSystemAccentColor ;
124123
125- if ( colorValues is
126- {
127- AccentColorDark1 : { } dark1 , AccentColorDark2 : { } dark2 , AccentColorDark3 : { } dark3 ,
128- AccentColorLight1 : { } light1 , AccentColorLight2 : { } light2 , AccentColorLight3 : { } light3
129- } )
130- {
131- // The platform reported the OS-computed shades (Windows, via UISettings);
132- // use them verbatim so the palette matches the OS exactly.
133- ( _systemAccentColorDark1 , _systemAccentColorDark2 , _systemAccentColorDark3 ) = ( dark1 , dark2 , dark3 ) ;
134- ( _systemAccentColorLight1 , _systemAccentColorLight2 , _systemAccentColorLight3 ) = ( light1 , light2 , light3 ) ;
135- }
136- else if ( _systemAccentColor == s_defaultSystemAccentColor )
124+ if ( _systemAccentColor == s_defaultSystemAccentColor )
137125 {
138126 // Platforms without a real accent color report the default; use WinUI's static
139127 // shade values so the out-of-the-box palette matches WinUI exactly.
0 commit comments