Class ColorSwatch
A color swatch is a visual element that displays a color or a gradient.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class ColorSwatch : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, INotifyValueChanged<List<ColorEntry>>, ISizeableElement
Constructors
Name | Description |
---|---|
ColorSwatch() | Default Constructor. |
Fields
Name | Description |
---|---|
imageUssClassName | The ColorSwatch image styling class. |
roundUssClassName | The ColorSwatch round styling class. |
sizeUssClassName | The ColorSwatch size styling class. |
ussClassName | The ColorSwatch main styling class. |
Properties
Name | Description |
---|---|
color | The single color of the ColorSwatch. Setting this property will overwrite the current color entry list to contain only the given single color value. The property's getter always return the first item of the color entry list. |
round | Round variant of the ColorSwatch. |
size | The size of the ColorSwatch element. |
value | The color entry list. |
Methods
Name | Description |
---|---|
AddColor(Color, float) | Add a color entry in the current swatch. This methods is useful to create gradients dynamically. |
Refresh() | Force the refresh of the visual element. |
RemoveColor(int) | Remove a color entry from the current list. |
SetValueWithoutNotify(List<ColorEntry>) | Set the color entry list value, without being notified of any changes. |