Class ColorPaletteAsset
ScriptableObject wrapper for a ColorPaletteData, enabling palette authoring and sharing via Unity's asset system. The palette is editable in the Inspector and lazily converted to an immutable ColorPalette on first runtime access.
Inherited Members
Namespace: Scylla.Core.Util.Palette
Assembly: ScyllaCore.dll
Syntax
[ScyllaCreateAsset("Core/Color Palette", FileName = "Color Palette")]
public sealed class ColorPaletteAsset : ScriptableObject
Remarks
Asset workflow. Create via the Unity menu:
Assets > Create > Scylla > Core > Color Palette. Edit entries directly
in the Inspector using Unity's native color picker, text fields, and enum dropdowns.
Runtime access. Use the Palette property to get
the immutable ColorPalette. The conversion from serialized data is
performed once and cached. The cache is invalidated when the asset is modified
in the Inspector (via OnValidate).
Use cases. Standalone palette assets for retro color sets, custom game palettes, player-created color schemes saved to disk, or any scenario where a named color set needs to be an asset reference.
Properties
Data
Gets or sets the raw serialized palette data. Setting this value invalidates the cached Palette. Assigning a default-initialized ColorPaletteData (with null Name or Entries) will cause Palette to return null on next access.
Declaration
public ColorPaletteData Data { get; set; }
Property Value
| Type | Description |
|---|---|
| ColorPaletteData |
Palette
Gets the immutable ColorPalette representation of this asset. The palette is lazily built from the serialized data on first access and cached. Returns null if the asset data is invalid (empty name or no entries).
Declaration
public ColorPalette Palette { get; }
Property Value
| Type | Description |
|---|---|
| ColorPalette |