make colors make sense

This commit is contained in:
XtraCube committed 2024-08-27 15:38:08 -04:00
1 parent 76c39d9bdc
commit 10b8999f3e
2 files changed
+18 -4

No files matched your search

+14
View File
@@ -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));
}
+4 -4
View File
@@ -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)
{
}
}