Class ColorField
Color Field UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class ColorField : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<Color>, IValidatableElement<Color>, INotifyValueChanging<Color>, INotifyValueChanged<Color>, ISizeableElement, IPressable
Constructors
ColorField()
Default constructor.
Declaration
public ColorField()
Fields
colorPickerIconUssClassName
The ColorField color picker icon styling class.
Declaration
public const string colorPickerIconUssClassName = "appui-colorfield__color-picker-icon"
Field Value
Type | Description |
---|---|
string |
colorSwatchUssClassName
The ColorField color swatch styling class.
Declaration
public const string colorSwatchUssClassName = "appui-colorfield__color-swatch"
Field Value
Type | Description |
---|---|
string |
labelUssClassName
The ColorField label styling class.
Declaration
public const string labelUssClassName = "appui-colorfield__label"
Field Value
Type | Description |
---|---|
string |
showTextUssClassName
The ColorField showText styling class.
Declaration
public const string showTextUssClassName = "appui-colorfield--show-text"
Field Value
Type | Description |
---|---|
string |
sizeUssClassName
The ColorField size styling class.
Declaration
public const string sizeUssClassName = "appui-colorfield--size-"
Field Value
Type | Description |
---|---|
string |
swatchOnlyUssClassName
The ColorField swatch only styling class.
Declaration
public const string swatchOnlyUssClassName = "appui-colorfield--swatch-only"
Field Value
Type | Description |
---|---|
string |
ussClassName
The ColorField main styling class.
Declaration
public const string ussClassName = "appui-colorfield"
Field Value
Type | Description |
---|---|
string |
Properties
clickable
Clickable Manipulator for this AssetTargetField.
Declaration
public Pressable clickable { get; set; }
Property Value
Type | Description |
---|---|
Pressable |
colorPickerType
The ColorField color picker type.
Declaration
public ColorPickerType colorPickerType { get; set; }
Property Value
Type | Description |
---|---|
ColorPickerType |
contentContainer
The content container of this ColorField. This is null for ColorField.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
hdr
Whether to show the HDR colors in the ColorPicker.
Declaration
public bool hdr { get; set; }
Property Value
Type | Description |
---|---|
bool |
inlinePicker
The ColorPicker position relative to the ColorField. When this is true, the ColorPicker will be inlined instead of being displayed in a Popover.
Declaration
public bool inlinePicker { get; set; }
Property Value
Type | Description |
---|---|
bool |
invalid
The ColorField invalid state.
Declaration
public bool invalid { get; set; }
Property Value
Type | Description |
---|---|
bool |
showAlpha
Whether to show the alpha channel in the ColorPicker.
Declaration
public bool showAlpha { get; set; }
Property Value
Type | Description |
---|---|
bool |
showText
Whether to show the text label for the ColorField.
Declaration
public bool showText { get; set; }
Property Value
Type | Description |
---|---|
bool |
size
The ColorField size.
Declaration
public Size size { get; set; }
Property Value
Type | Description |
---|---|
Size |
swatchOnly
The ColorField type. When this is true, the ColorField will only show the swatch.
Declaration
public bool swatchOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
swatchSize
The ColorField swatch size.
Declaration
public Size swatchSize { get; set; }
Property Value
Type | Description |
---|---|
Size |
validateValue
The ColorField validation function.
Declaration
public Func<Color, bool> validateValue { get; set; }
Property Value
Type | Description |
---|---|
Func<Color, bool> |
value
The ColorField value.
Declaration
public Color value { get; set; }
Property Value
Type | Description |
---|---|
Color |
Methods
GetSizeUssClassName(Size)
Declaration
public static string GetSizeUssClassName(Size enumValue)
Parameters
Type | Name | Description |
---|---|---|
Size | enumValue |
Returns
Type | Description |
---|---|
string |
SetValueWithoutNotify(Color)
Sets the ColorField value without notifying the ColorField.
Declaration
public void SetValueWithoutNotify(Color newValue)
Parameters
Type | Name | Description |
---|---|---|
Color | newValue | The new ColorField value. |