Skip to content

Commit

Permalink
1.1.3 -> 1.1.4 第93次更新
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceTimee committed Dec 20, 2024
1 parent 1a08c65 commit bd73327
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Consts/AboutConst.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using System.Reflection;
using System.Windows.Media;

namespace Sheas_Cealer.Consts;

internal abstract class AboutConst : AboutMultilangConst
{
public static Color AccentBlueColor => (Color)ColorConverter.ConvertFromString("#2196F3");
public static Color AccentRedColor => (Color)ColorConverter.ConvertFromString("#F44336");

public static string DeveloperButtonUrl => "https://www.spacetimee.xyz";
public static string VersionButtonVersionContent => Assembly.GetExecutingAssembly().GetName().Version!.ToString()[..^2];
public static string VersionButtonUrl => "https://spacetime.lanzouu.com/b017hp0lc";
Expand Down
3 changes: 2 additions & 1 deletion Preses/GlobalPres.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using MaterialDesignThemes.Wpf;
using Sheas_Cealer.Consts;
using Sheas_Cealer.Props;
using Sheas_Cealer.Utils;
using System.Diagnostics;
Expand Down Expand Up @@ -39,5 +40,5 @@ partial void OnIsLightThemeChanged(bool? value)
}

[ObservableProperty]
private static Color accentForegroundColor = (Color)ColorConverter.ConvertFromString("#2196F3");
private static Color accentForegroundColor = AboutConst.AccentBlueColor;
}
5 changes: 3 additions & 2 deletions Utils/ForegroundGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Sheas_Cealer.Consts;
using System;
using System.Windows.Media;

namespace Sheas_Cealer.Utils;
Expand All @@ -23,7 +24,7 @@ internal static (Color?, Color) GetForeground(int red, int green, int blue)

return (blackContrast >= 5.5 && whiteContrast >= 2.5 ? null :
blackContrast >= whiteContrast ? Colors.Black : Colors.White,
(Color)ColorConverter.ConvertFromString(blueContrast >= redContrast ? "#2196F3" : "#F44336"));
blueContrast >= redContrast ? AboutConst.AccentBlueColor : AboutConst.AccentRedColor);
}

private static double GammaCorrect(double component) => component <= 0.03928 ? component / 12.92 : Math.Pow((component + 0.055) / 1.055, 2.4);
Expand Down
4 changes: 2 additions & 2 deletions Wins/AboutWin.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" d:Foreground="#2196F3"
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" d:Foreground="{x:Static consts:AboutConst.AccentBlueColor}"
Foreground="{Binding AccentForegroundColor, Converter={x:Static convs:AboutConv.AboutAccentButtonForegroundConv}}"
Content="{x:Static consts:AboutConst.DeveloperButtonContent}"
ToolTip="{x:Static consts:AboutConst.DeveloperButtonUrl}"
Click="AboutButton_Click" />
<Button x:Name="VersionButton"
Grid.Row="1" Grid.Column="0" Margin="5" d:Foreground="#2196F3" d:Content="# # #: #.#.#"
Grid.Row="1" Grid.Column="0" Margin="5" d:Foreground="{x:Static consts:AboutConst.AccentBlueColor}" d:Content="# # #: #.#.#"
Foreground="{Binding AccentForegroundColor, Converter={x:Static convs:AboutConv.AboutAccentButtonForegroundConv}}"
ToolTip="{x:Static consts:AboutConst.VersionButtonUrl}"
Click="AboutButton_Click">
Expand Down

0 comments on commit bd73327

Please sign in to comment.