Repository navigation
Color Scheme
ColorScheme assets are palettes that applied to groups of MaskableGraphics by ColorSchemeController. Slot i maps to scheme color i.
Perfect for keeping colors consistent and hot-swapping color themes for simple graphics that can be colored with the component's color.
Create an asset: Create → Mane Tools → Color Scheme.
using Mane.Unity.UI;
using UnityEngine;
public class ThemeSwitcher : MonoBehaviour
{
[SerializeField] private ColorSchemeController _controller;
[SerializeField] private ColorScheme _dayScheme;
[SerializeField] private ColorScheme _nightScheme;
public void GoNight()
{
_controller.ColorScheme = _nightScheme; // snap, or...
_controller.AnimateTo(_nightScheme, .35f); // lerp (see caveats)
}
}ScriptableObject. _colors is a Color[]. The indexer returns white if the index is out of range (or the array is null). Length is the array length.

Add Component → Mane Tools → UI → Color Scheme Controller.

-
ColorSchemesetter stops a runningAnimateToand callsRefresh()immediately. -
Refresh()paints every graphic in slotiwith scheme colori. A missing scheme, or empty slots: no-op. -
GetGraphicColor(i)is the first graphic in that slot (white if none). -
SetGraphicsColor(i, color)writes every graphic in the slot. -
SetColorSchemeWithoutRefreshstores the asset without painting (used while animating).
OnEnable refreshes, so an animation cut short by deactivation still ends on the target colors. The custom inspector's OnEnable also refreshes, so you see colors without entering Play mode.
Lerps the current graphic colors toward colorScheme over duration seconds (Time.deltaTime). The default curve is linear.
-
duration <= 0, no current scheme, or an inactive controller → snap via theColorSchemesetter. - A null target scheme, or a different
Lengthfrom the current scheme → no-op. - Stops the previous animation, and continues from the current colors.
openupm add com.manefunction.tools-unity-ui