Struct ColorSwatchCollectionData
Unity-serializable data representation of a ColorSwatchCollection. Used as the backing storage for ColorSwatchCollectionAsset.
Inherited Members
Namespace: Scylla.Core.Util.Palette
Assembly: ScyllaCore.dll
Syntax
[Serializable]
public struct ColorSwatchCollectionData
Remarks
Serialization bridge. ColorSwatchCollection is immutable and not directly serializable by Unity. This struct holds the same data in a Unity-serializable format. Use ToColorSwatchCollection() to convert to the immutable runtime type.
Inspector editing. Unity natively serializes UnityEngine.Color fields with color pickers and string fields with text input, so this struct is fully Inspector-editable without custom property drawers.
Constructors
ColorSwatchCollectionData(string, ColorSwatchEntryData[])
Creates a new collection data from the specified values.
Declaration
public ColorSwatchCollectionData(string name, ColorSwatchEntryData[] entries)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Collection name. |
| ColorSwatchEntryData[] | entries | Swatch entries. |
Fields
Entries
The ordered array of swatch entries.
Declaration
[Tooltip("Swatch entries in collection order.")]
public ColorSwatchEntryData[] Entries
Field Value
| Type | Description |
|---|---|
| ColorSwatchEntryData[] |
Name
The human-readable name of this collection.
Declaration
[Tooltip("Collection name (e.g., 'Swatches').")]
public string Name
Field Value
| Type | Description |
|---|---|
| string |
Methods
ToColorSwatchCollection()
Converts this serialized data to an immutable
ColorSwatchCollection. Returns null if the data
is structurally invalid (null or empty Name, or null
Entries array).
Declaration
public ColorSwatchCollection ToColorSwatchCollection()
Returns
| Type | Description |
|---|---|
| ColorSwatchCollection | A new immutable ColorSwatchCollection, or |