From 10b8999f3ef7625ee224dc62a4bc628cccc3cc23 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:38:08 -0400 Subject: [PATCH] make colors make sense --- MiraAPI.Example/ExampleColors.cs | 14 ++++++++++++++ MiraAPI/Colors/CustomColor.cs | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 MiraAPI.Example/ExampleColors.cs diff --git a/MiraAPI.Example/ExampleColors.cs b/MiraAPI.Example/ExampleColors.cs new file mode 100644 index 0000000..3212093 --- /dev/null +++ b/MiraAPI.Example/ExampleColors.cs @@ -0,0 +1,14 @@ +using MiraAPI.Colors; +using UnityEngine; + +namespace MiraAPI.Example; + +[RegisterCustomColors] +public static class ExampleColors +{ + public static CustomColor Cerulean { get; } = new("Cerulean", new Color(0.0f, 0.48f, 0.65f)); + + public static CustomColor Rose { get; } = new("Rose", new Color(0.98f, 0.26f, 0.62f)); + + public static CustomColor Gold { get; } = new("Gold", new Color(1.0f, 0.84f, 0.0f)); +} \ No newline at end of file diff --git a/MiraAPI/Colors/CustomColor.cs b/MiraAPI/Colors/CustomColor.cs index c502c09..3e3df97 100644 --- a/MiraAPI/Colors/CustomColor.cs +++ b/MiraAPI/Colors/CustomColor.cs @@ -3,21 +3,21 @@ using Reactor.Localization.Utilities; using UnityEngine; namespace MiraAPI.Colors; -public sealed class CustomColor(Color32 mainColor, Color32 shadowColor, StringNames name) +public sealed class CustomColor(StringNames name, Color32 mainColor, Color32 shadowColor) { public Color32 MainColor { get; } = mainColor; public Color32 ShadowColor { get; } = shadowColor; public StringNames Name { get; } = name; - public CustomColor(Color32 mainColor, StringNames name) : this(mainColor, mainColor.GetShadowColor(60), name) + public CustomColor(StringNames name, Color32 mainColor) : this(name, mainColor, mainColor.GetShadowColor(60)) { } - public CustomColor(Color32 mainColor, string name) : this(mainColor, mainColor.GetShadowColor(60), name) + public CustomColor(string name, Color32 mainColor) : this(name, mainColor, mainColor.GetShadowColor(60)) { } - public CustomColor(Color32 mainColor, Color32 shadowColor, string name) : this(mainColor, shadowColor, CustomStringName.CreateAndRegister(name)) + public CustomColor(string name, Color32 mainColor, Color32 shadowColor) : this(CustomStringName.CreateAndRegister(name), mainColor, shadowColor) { } } \ No newline at end of file