Struct ColorPaletteEntryData
A single serializable color entry for use in ColorPaletteData. Bridges between Unity serialization and the immutable ColorPaletteEntry.
Inherited Members
Namespace: Scylla.Core.Util.Palette
Assembly: ScyllaCore.dll
Syntax
[Serializable]
public struct ColorPaletteEntryData
Remarks
This struct is the mutable, serializable counterpart to the immutable ColorPaletteEntry. Unity serializes its fields directly, enabling Inspector editing with color pickers, text input, and enum dropdowns. Convert to ColorPaletteEntry via the ToColorPalette() method; no direct conversion exists to prevent accidental use of partially initialized data.
Constructors
ColorPaletteEntryData(string, Color, ColorRole, string[], bool)
Creates a new entry data from the specified values.
Declaration
public ColorPaletteEntryData(string name, Color color, ColorRole role = ColorRole.None, string[] tags = null, bool isLocked = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The color name. |
| Color | color | The color value. |
| ColorRole | role | The semantic role. |
| string[] | tags | Optional tags for categorization. |
| bool | isLocked | Whether the entry is locked against editing. |
Fields
Color
The RGBA color value in float precision (0.0-1.0 per component). Alpha is fully supported and preserved through serialization and conversion.
Declaration
[Tooltip("Color value with full alpha support.")]
public Color Color
Field Value
| Type | Description |
|---|---|
| Color |
IsLocked
Whether this entry is locked against editing in editor tools. A locked entry cannot be modified or deleted through the editor UI.
Declaration
[Tooltip("Lock this entry to prevent editing in editor tools.")]
public bool IsLocked
Field Value
| Type | Description |
|---|---|
| bool |
Name
The human-readable name of this color entry, used as the lookup key in the
parent palette. Must be unique within the palette (case-insensitive) and
non-empty. If left null or empty in the Inspector, a fallback name of the
form "Color_N" is assigned when ToColorPalette()
converts the data.
Declaration
[Tooltip("Unique color name used for lookup (case-insensitive).")]
public string Name
Field Value
| Type | Description |
|---|---|
| string |
Role
Optional semantic role for fallback resolution when mapping between palettes with different naming conventions. Use None for generic/retro palettes that do not participate in role-based resolution.
Declaration
[Tooltip("Semantic role for palette mapping fallback (None for generic palettes).")]
public ColorRole Role
Field Value
| Type | Description |
|---|---|
| ColorRole |
Tags
Optional string tags for categorization and filtering of palette entries (e.g., "background", "ui", "environment").
Declaration
[Tooltip("Optional tags for categorization and filtering.")]
public string[] Tags
Field Value
| Type | Description |
|---|---|
| string[] |