diff --git a/App.xaml.cs b/App.xaml.cs index dece8de..459c28f 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -17,25 +17,31 @@ public partial class App : Application { _ = new SettingsPres(); + #region Primary Color PaletteHelper paletteHelper = new(); Theme newTheme = paletteHelper.GetTheme(); System.Drawing.Color newColor = Settings.Default.PrimaryColor; newTheme.SetPrimaryColor(Color.FromRgb(newColor.R, newColor.G, newColor.B)); paletteHelper.SetTheme(newTheme); + #endregion Primary Color + #region Background Color if (Environment.OSVersion.Version.Build < 22000) { Style newWindowStyle = new(typeof(Window), Current.Resources["CommonWindow"] as Style); newWindowStyle.Setters.Add(new Setter(Window.BackgroundProperty, new DynamicResourceExtension("MaterialDesignBackground"))); Current.Resources["CommonWindow"] = newWindowStyle; } + #endregion Background Color + #region Foreground Color Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B); Style newButtonStyle = new(typeof(Button), Current.Resources[typeof(Button)] as Style); newButtonStyle.Setters.Add(new Setter(Button.ForegroundProperty, foregroundColor.HasValue ? new SolidColorBrush(foregroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground"))); Current.Resources[typeof(Button)] = newButtonStyle; + #endregion Foreground Color new MainWin(e.Args).Show(); } diff --git a/Utils/GlobalCealCleaner.cs b/Utils/GlobalCealCleaner.cs index 321a2db..6ab3677 100644 --- a/Utils/GlobalCealCleaner.cs +++ b/Utils/GlobalCealCleaner.cs @@ -39,4 +39,4 @@ namespace Sheas_Cealer.Utils IsCleaning = false; } } -} +} \ No newline at end of file