ColorField
Makes a field for selecting a color. For more information, refer to UXML element ColorField.
Read time 8 minutesLast updated 11 days ago
Definition
- Type: Class
- Namespace: UnityEditor.UIElements
- Assembly: UnityEditor.CoreModule
- Inherits from: BaseField<Color>
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, INotifyValueChanged<Color>, IMixedValueSupport
[Icon("UIToolkit/Icons/ColorField.png")]public class ColorField : BaseField<Color>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, INotifyValueChanged<Color>, IMixedValueSupport
Static Fields
Value | Description |
|---|---|
| colorContainerUssClassName | USS class name of color container elements in elements of this type. |
| colorUssClassName | USS class name of color elements in elements of this type. |
| eyeDropperUssClassName | USS class name of eyedropper elements in elements of this type. |
| gradientContainerUssClassName | USS class name of gradient container elements in elements of this type. |
| hdrLabelUssClassName | USS class name of hdr label elements in elements of this type. |
| inputUssClassName | USS class name of input elements in elements of this type. |
| labelUssClassName | USS class name of labels in elements of this type. |
| mixedValueColorUssClassName | USS class name of color elements in elements of this type when showing mixed values. |
| ussClassName | USS class name of elements of this type. |
Constructors
Constructor | Description |
|---|---|
| ColorField() | Initializes and returns an instance of ColorField. |
| ColorField(System.String) | Initializes and returns an instance of ColorField. |
Properties
Property | Description |
|---|---|
| hdr | If true, treats the color as an HDR value. If false, treats the color as a standard LDR value. |
| showAlpha | If true, allows the user to set an alpha value for the color. If false, hides the alpha component. |
| showEyeDropper | If true, the color picker will show the eyedropper control. If false, the color picker won't show the eyedropper control. |