diff --git a/Sheas-Cealer.csproj b/Sheas-Cealer.csproj index 67733d8..0f7c952 100644 --- a/Sheas-Cealer.csproj +++ b/Sheas-Cealer.csproj @@ -8,10 +8,10 @@ Just Ceal It Space Time Space Time - 1.1.3 - 1.1.3 - 1.1.3 - 1.1.3 + 1.1.4 + 1.1.4 + 1.1.4 + 1.1.4 Tool;Sheas;Cealer;Sni Sheas-Cealer-Logo.ico Sheas Cealer Logo.png diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs index 8b84ff3..4998396 100644 --- a/Wins/MainWin.xaml.cs +++ b/Wins/MainWin.xaml.cs @@ -454,11 +454,23 @@ public partial class MainWin : Window PaletteHelper paletteHelper = new(); Theme newTheme = paletteHelper.GetTheme(); + Color newColor = Color.FromRgb((byte)random.Next(256), (byte)random.Next(256), (byte)random.Next(256)); + bool isLightTheme = random.Next(2) == 0; - newTheme.SetPrimaryColor(Color.FromRgb((byte)random.Next(256), (byte)random.Next(256), (byte)random.Next(256))); - newTheme.SetBaseTheme(random.Next(2) == 0 ? BaseTheme.Light : BaseTheme.Dark); + newTheme.SetPrimaryColor(newColor); + newTheme.SetBaseTheme(isLightTheme ? BaseTheme.Light : BaseTheme.Dark); paletteHelper.SetTheme(newTheme); + foreach (Window currentWindow in Application.Current.Windows) + BorderThemeSetter.SetBorderTheme(currentWindow, isLightTheme); + + Color? foregroundColor = ForegroundGenerator.GetForeground(newColor.R, newColor.G, newColor.B); + + if (foregroundColor.HasValue) + Application.Current.Resources["MaterialDesignBackground"] = new SolidColorBrush(foregroundColor.Value); + else + Application.Current.Resources.Remove("MaterialDesignBackground"); + if (GameFlashInterval > 100) GameFlashInterval += random.Next(1, 4);