-
Notifications
You must be signed in to change notification settings - Fork 26
Colors
XtraCube edited this page Feb 27, 2026
·
1 revision
Mira API lets you register custom player colors that appear in the color selection screen alongside the vanilla colors.
Create a static class decorated with [RegisterCustomColors]. Each CustomColor property in the class is automatically discovered and registered.
[RegisterCustomColors]
public static class ExampleColors
{
public static CustomColor Cerulean { get; } = new("Cerulean", new Color(0.0f, 0.48f, 0.65f))
{
ColorBrightness = CustomColorBrightness.Lighter,
};
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));
}CustomColor represents a single player color with a main color, a shadow color used for shading on the player body, a name, and an optional brightness hint.
| Constructor | Description |
|---|---|
new CustomColor(StringNames name, Color32 main, Color32 shadow) |
Full control over name, main color, and shadow color. |
new CustomColor(StringNames name, Color32 main) |
Shadow color is auto-generated by darkening main by 60 units per channel. |
new CustomColor(string name, Color32 main, Color32 shadow) |
Same as the first overload, but takes a plain string for the name (registered automatically as a StringNames). |
new CustomColor(string name, Color32 main) |
Same as the second overload, but takes a plain string name. |
| Property | Type | Default | Description |
|---|---|---|---|
Name |
StringNames |
Set by constructor | The localization key for the color name shown in the color picker. |
MainColor |
Color32 |
Set by constructor | The primary color applied to the player body. |
ShadowColor |
Color32 |
Auto-derived from MainColor
|
The shadow/shading color on the player body. |
ColorBrightness |
CustomColorBrightness |
Darker |
A hint used for accessibility. Lighter or Darker. |
PaletteManager provides read access to the list of registered custom colors.
| Member | Description |
|---|---|
PaletteManager.RegisteredColors |
A read-only list of all CustomColor instances that have been registered. |
Colors are automatically appended to the game's Palette.PlayerColors, Palette.ShadowColors, Palette.ColorNames, Palette.TextColors, and Palette.TextOutlineColors arrays at startup.