Skip to content

Commit

Permalink
Update Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbugl committed Jul 9, 2022
1 parent 7f28d0b commit 777f473
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Model/Side.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ namespace ImageGenerator.Model;
internal enum Side
{
Hikari,
Tairitsu
}
Tairitsu,
Achromic
}
1 change: 1 addition & 0 deletions Path.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ internal static Path ArcaeaRating(short potential)
{
var img = potential switch
{
>= 1300 => "7",
>= 1250 => "6",
>= 1200 => "5",
>= 1100 => "4",
Expand Down
15 changes: 13 additions & 2 deletions UI/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ internal static class Color
{
internal static readonly System.Drawing.Color White = System.Drawing.Color.White,
Black = System.Drawing.Color.Black,
Light = FromArgb(150, 100, 200, 225),
Conflict = FromArgb(150, 50, 20, 75),
Hikari = FromArgb(150, 100, 200, 225),
Tairitsu = FromArgb(150, 50, 20, 75),
Achromic = FromArgb(150, 180, 180, 180),
PmColor = FromArgb(150, 180, 200), ArcGray = FromArgb(60, 60, 60),
ArcPurple = FromArgb(31, 30, 51), GnaqGray = FromArgb(110, 110, 110),
AzusaGray = FromArgb(90, 90, 90);
Expand All @@ -18,4 +19,14 @@ internal static System.Drawing.Color FromArgb(int alpha, System.Drawing.Color ba

internal static System.Drawing.Color FromArgb(int a, int r, int g, int b) =>
System.Drawing.Color.FromArgb(a, r, g, b);


internal static System.Drawing.Color GetBySide(int side) =>
side switch
{
0 => Hikari,
1 => Tairitsu,
2 => Achromic,
_ => White
};
}
4 changes: 1 addition & 3 deletions UI/ImageGenerator/ArcBackgroundGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ private async Task<BackGround> GenerateArcV2(Path path)
new LineModel(Color.White, 3, new(0, 920), new(1920, 920)),
new LineModel(Color.White, 1, new(0, 705), new(1920, 705)),
new LineModel(Color.White, 1, new(0, 955), new(1920, 955)),
new RectangleModel(_info.Side == (int)Side.Hikari
? Color.Light
: Color.Conflict, new(145, 685, 320, 320)),
new RectangleModel(Color.GetBySide(_info.Side), new(145, 685, 320, 320)),
new ImageModel(song, 130, 670, 320, 320),
new TextWithShadowModel(_info.GetSongName(50), Font.Andrea56, 510, 750));
background.SaveAsPng(path);
Expand Down

0 comments on commit 777f473

Please sign in to comment.