Class ColorGradientAsset
ScriptableObject wrapper for a ColorGradientData, enabling gradient authoring and sharing via Unity's asset system. The gradient is editable in the Inspector and lazily converted to an immutable ColorGradient on first runtime access.
Inherited Members
Namespace: Scylla.Core.Util.Palette
Assembly: ScyllaCore.dll
Syntax
[CreateAssetMenu(fileName = "Color Gradient", menuName = "Scylla/Core/Color Gradient")]
public sealed class ColorGradientAsset : ScriptableObject
Remarks
Asset workflow. Create via the Unity menu:
Assets > Create > Scylla > Core > Color Gradient. Edit stops directly
in the Inspector using Unity's native color picker and offset sliders.
Runtime access. Use the Gradient property to get
the immutable ColorGradient. The conversion from serialized data is
performed once and cached. The cache is invalidated when the asset is modified
in the Inspector (via OnValidate).
Properties
Data
Gets or sets the raw serialized gradient data. Setting this value invalidates the cached Gradient.
Declaration
public ColorGradientData Data { get; set; }
Property Value
| Type | Description |
|---|---|
| ColorGradientData |
Gradient
Gets the immutable ColorGradient representation of this asset. Lazily built from the serialized data on first access and cached. Returns null if the asset data is invalid (empty name or fewer than 2 stops).
Declaration
public ColorGradient Gradient { get; }
Property Value
| Type | Description |
|---|---|
| ColorGradient |