private static void ReplaceBrushWithOpacity(ResourceDictionary dictionary, string name, string immersiveAccentName, double opacity) { var color = AccentColorService.GetColorByTypeName(immersiveAccentName); color.A = (byte)(opacity * 255); dictionary[name] = new SolidColorBrush(color); }
private static void SetBrushWithOpacity(ResourceDictionary dictionary, string name, string immersiveAccentName, double opacity) { var color = AccentColorService.GetColorByTypeName(immersiveAccentName); color.A = (byte)(opacity * 255); ((SolidColorBrush)dictionary[name]).Color = color; }
private static Color GetWindowBackgroundColor() { string resource; if (SystemParameters.HighContrast) { resource = "ImmersiveApplicationBackground"; } else if (UserSystemPreferencesService.UseAccentColor) { resource = IsWindowTransparencyEnabled ? "ImmersiveSystemAccentDark2" : "ImmersiveSystemAccentDark1"; } else { resource = "ImmersiveDarkChromeMedium"; } var color = AccentColorService.GetColorByTypeName(resource); color.A = (byte)(IsWindowTransparencyEnabled ? 190 : 255); return(color); }
private static void ReplaceBrush(ResourceDictionary dictionary, string name, string immersiveAccentName) { dictionary[name] = new SolidColorBrush(AccentColorService.GetColorByTypeName(immersiveAccentName)); }