mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
make colors make sense
This commit is contained in:
1 parent
76c39d9bdc
commit
10b8999f3e
2 files changed
+18
-4
No files matched your search
@@ -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));
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user