Color Palette Attribute

ColorPalette is used on any Color property, and allows for choosing colors from different definable palettes. Use this to allow the user to choose from a set of predefined color options.

public Color ColorOptions;

public Color UnderwaterColor;

[ColorPalette("My Palette")]
public Color MyColor;

public string DynamicPaletteName = "Clovers";

// The ColorPalette attribute supports both 
// member references and attribute expressions.
public Color DynamicPaletteColor;

[ColorPalette("Fall"), HideLabel]
public Color WideColorPalette;

public Color[] ColorArray;

// ------------------------------------
// Color palettes can be accessed and modified from code.
// Note that the color palettes will NOT automatically be included in your builds.
// But you can easily fetch all color palettes via the ColorPaletteManager 
// and include them in your game like so:
// ------------------------------------

[FoldoutGroup("Color Palettes", expanded: false)]
[ListDrawerSettings(IsReadOnly = true)]
public List<ColorPalette> ColorPalettes;


[FoldoutGroup("Color Palettes"), Button(ButtonSizes.Large), GUIColor(0, 1, 0), PropertyOrder(8)]
private void FetchColorPalettes()
    this.ColorPalettes = Sirenix.OdinInspector.Editor.ColorPaletteManager.Instance.ColorPalettes
        .Select(x => new ColorPalette()
            Name = x.Name,
            Colors = x.Colors.ToArray()

public class ColorPalette
    public string Name;

    [ListDrawerSettings(IsReadOnly = true, Expanded = false)]
    public Color[] Colors;