Class ColorSlider
A slider that allows the user to select a color value.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public sealed class ColorSlider : BaseSlider<float, float>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<float>, IValidatableElement<float>, INotifyValueChanging<float>, INotifyValueChanged<float>
Constructors
ColorSlider()
Default constructor.
Declaration
public ColorSlider()
Fields
sizeUssClassName
The ColorSlider size styling class.
Declaration
public static readonly string sizeUssClassName
Field Value
| Type | Description |
|---|---|
| string |
thumbContainerContainerUssClassName
The ColorSlider thumb container container styling class.
Declaration
public static readonly string thumbContainerContainerUssClassName
Field Value
| Type | Description |
|---|---|
| string |
thumbContainerUssClassName
The ColorSlider thumb container styling class.
Declaration
public static readonly string thumbContainerUssClassName
Field Value
| Type | Description |
|---|---|
| string |
thumbContentUssClassName
The ColorSlider thumb content styling class.
Declaration
public static readonly string thumbContentUssClassName
Field Value
| Type | Description |
|---|---|
| string |
thumbUssClassName
The ColorSlider thumb styling class.
Declaration
public static readonly string thumbUssClassName
Field Value
| Type | Description |
|---|---|
| string |
trackSwatchUssClassName
The ColorSlider track swatch styling class.
Declaration
public static readonly string trackSwatchUssClassName
Field Value
| Type | Description |
|---|---|
| string |
trackUssClassName
The ColorSlider track styling class.
Declaration
public static readonly string trackUssClassName
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The ColorSlider main styling class.
Declaration
public static readonly string ussClassName
Field Value
| Type | Description |
|---|---|
| string |
Properties
colorRange
The current color range in the track.
Declaration
public Gradient colorRange { get; set; }
Property Value
| Type | Description |
|---|---|
| Gradient |
colorValue
The currently selected color value.
Declaration
public Color colorValue { get; }
Property Value
| Type | Description |
|---|---|
| Color |
incrementFactor
The delta value used when interacting with the slider with the keyboard.
Declaration
public float incrementFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
size
The current size of the ActionButton.
Declaration
public Size size { get; set; }
Property Value
| Type | Description |
|---|---|
| Size |
Methods
Clamp(float, float, float)
Utility method to clamp a TValueType value between specified bounds.
Declaration
protected override float Clamp(float v, float lowBound, float highBound)
Parameters
| Type | Name | Description |
|---|---|---|
| float | v | The value to clamp. |
| float | lowBound | Minimum |
| float | highBound | Maximum |
Returns
| Type | Description |
|---|---|
| float | The clamped value. |
Overrides
Decrement(float)
Method to implement which returns the decrement of a given value.
Declaration
protected override float Decrement(float val)
Parameters
| Type | Name | Description |
|---|---|---|
| float | val | The value to decrement. |
Returns
| Type | Description |
|---|---|
| float | The decremented value. |
Overrides
GetSliderRect()
Returns the rect of the interactive part of the slider.
Declaration
protected override Rect GetSliderRect()
Returns
| Type | Description |
|---|---|
| Rect | The rect of the interactive part of the slider. |
Overrides
Increment(float)
Method to implement which returns the increment of a given value.
Declaration
protected override float Increment(float val)
Parameters
| Type | Name | Description |
|---|---|---|
| float | val | The value to increment. |
Returns
| Type | Description |
|---|---|
| float | The incremented value. |
Overrides
InvokeValueChangedCallbacks()
Called when the value of the slider has changed via the value property.
Declaration
protected override void InvokeValueChangedCallbacks()
Overrides
ParseStringToValue(string, out float)
Declaration
protected override bool ParseStringToValue(string strValue, out float v)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strValue | |
| float | v |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
SetValueWithoutNotify(float)
Sets the value of the slider without notifying the listeners.
Declaration
public override void SetValueWithoutNotify(float newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| float | newValue | The new value of the slider. |
Overrides
SliderLerpUnclamped(float, float, float)
Declaration
protected override float SliderLerpUnclamped(float a, float b, float t)
Parameters
| Type | Name | Description |
|---|---|---|
| float | a | |
| float | b | |
| float | t |
Returns
| Type | Description |
|---|---|
| float |
Overrides
SliderNormalizeValue(float, float, float)
Declaration
protected override float SliderNormalizeValue(float currentValue, float lowerValue, float higherValue)
Parameters
| Type | Name | Description |
|---|---|---|
| float | currentValue | |
| float | lowerValue | |
| float | higherValue |
Returns
| Type | Description |
|---|---|
| float |