diff --git a/MiraAPI/Colors/CustomColor.cs b/MiraAPI/Colors/CustomColor.cs index 996bb467..f3c38395 100644 --- a/MiraAPI/Colors/CustomColor.cs +++ b/MiraAPI/Colors/CustomColor.cs @@ -48,6 +48,11 @@ public class CustomColor(StringNames name, Color32 mainColor, Color32 shadowColo /// public StringNames Name { get; set; } = name; + /// + /// Gets the id of the color. + /// + public int ColorId { get; internal set; } = -1; + /// /// Gets or sets whether the color is lighter or darker. Can be used to help with colorblind stuff. /// diff --git a/MiraAPI/Colors/PaletteManager.cs b/MiraAPI/Colors/PaletteManager.cs index 3b9cd4af..760822fc 100644 --- a/MiraAPI/Colors/PaletteManager.cs +++ b/MiraAPI/Colors/PaletteManager.cs @@ -50,6 +50,11 @@ public static class PaletteManager var colors = CustomColors.Select(x => x.MainColor).ToArray(); var shadowColors = CustomColors.Select(x => x.ShadowColor).ToArray(); var stringNames = CustomColors.Select(x => x.Name).ToArray(); + var newColorId = originalLength; + foreach (var color in CustomColors) + { + color.ColorId = newColorId++; + } Palette.PlayerColors = Palette.PlayerColors.ToArray().AddRangeToArray(colors); Palette.ShadowColors = Palette.ShadowColors.ToArray().AddRangeToArray(shadowColors);