File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ public static class ApiInfo
4545 private static bool ? _canCreateRectangleClip ;
4646 public static bool CanCreateRectangleClip => _canCreateRectangleClip ??= ApiInformation . IsMethodPresent ( "Windows.UI.Composition.Compositor" , "CreateRectangleClip" ) ;
4747
48+ private static bool ? _canSetTintLuminosityOpacity ;
49+ public static bool CanSetTintLuminosityOpacity => _canSetTintLuminosityOpacity ??= ApiInformation . IsApiContractPresent ( "Windows.Foundation.UniversalApiContract" , 10 ) ;
50+
4851 // We only enable shadows on Windows 11 for three reasons:
4952 // First: they look terrible on Windows 10
5053 // Second: they are way more optimized on Windows 11 (they use a nine-grid instead of dynamically casted shadows)
Original file line number Diff line number Diff line change @@ -409,7 +409,14 @@ Color GetShade(AccentShade shade)
409409 {
410410 update . TintColor = tintColor ;
411411 update . TintOpacity = tintOpacity ;
412- update . TintLuminosityOpacity = tintLuminosityOpacity ;
412+ if ( ApiInfo . CanSetTintLuminosityOpacity )
413+ {
414+ update . TintLuminosityOpacity = tintLuminosityOpacity ;
415+ }
416+ else
417+ {
418+ update . SetValue ( AcrylicBrush . TintLuminosityOpacityProperty , tintLuminosityOpacity ) ;
419+ }
413420 update . FallbackColor = fallbackColor ;
414421 update . AlwaysUseFallback = ! PowerSavingPolicy . AreMaterialsEnabled ;
415422 } ) ;
You can’t perform that action at this time.
0 commit comments