docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ColorSlider

    A slider that allows the user to select a color value.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    ExVisualElement
    BaseSlider<float, float>
    ColorSlider
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IInputElement<float>
    IValidatableElement<float>
    INotifyValueChanging<float>
    INotifyValueChanged<float>
    Inherited Members
    BaseSlider<float, float>.lowValue
    BaseSlider<float, float>.highValue
    BaseSlider<float, float>.formatString
    BaseSlider<float, float>.SetValueWithoutNotify(float)
    BaseSlider<float, float>.value
    BaseSlider<float, float>.invalid
    BaseSlider<float, float>.validateValue
    ExVisualElement.contentContainer
    ExVisualElement.outlineColor
    ExVisualElement.backgroundColor
    ExVisualElement.passMask
    BaseVisualElement.contextPrefix
    BaseVisualElement.scaleOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    BaseVisualElement.GetLayoutDirectionUssClassName(Dir)
    VisualElement.disabledUssClassName
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    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 const string sizeUssClassName = "appui-colorslider--size-"
    Field Value
    Type Description
    string

    thumbContainerContainerUssClassName

    The ColorSlider thumb container container styling class.

    Declaration
    public const string thumbContainerContainerUssClassName = "appui-colorslider__thumbcontainer-container"
    Field Value
    Type Description
    string

    thumbContainerUssClassName

    The ColorSlider thumb container styling class.

    Declaration
    public const string thumbContainerUssClassName = "appui-colorslider__thumbcontainer"
    Field Value
    Type Description
    string

    thumbContentUssClassName

    The ColorSlider thumb content styling class.

    Declaration
    public const string thumbContentUssClassName = "appui-colorslider__thumb-content"
    Field Value
    Type Description
    string

    thumbUssClassName

    The ColorSlider thumb styling class.

    Declaration
    public const string thumbUssClassName = "appui-colorslider__thumb"
    Field Value
    Type Description
    string

    trackSwatchUssClassName

    The ColorSlider track swatch styling class.

    Declaration
    public const string trackSwatchUssClassName = "appui-colorslider__colorcontainer"
    Field Value
    Type Description
    string

    trackUssClassName

    The ColorSlider track styling class.

    Declaration
    public const string trackUssClassName = "appui-colorslider__track"
    Field Value
    Type Description
    string

    ussClassName

    The ColorSlider main styling class.

    Declaration
    public const string ussClassName = "appui-colorslider"
    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
    BaseSlider<float, float>.Clamp(float, float, float)

    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
    BaseSlider<float, float>.Decrement(float)

    GetSizeUssClassName(Size)

    Declaration
    public static string GetSizeUssClassName(Size enumValue)
    Parameters
    Type Name Description
    Size enumValue
    Returns
    Type Description
    string

    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
    BaseSlider<float, float>.GetSliderRect()

    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
    BaseSlider<float, float>.Increment(float)

    InvokeValueChangedCallbacks()

    Called when the value of the slider has changed via the value property.

    Declaration
    protected override void InvokeValueChangedCallbacks()
    Overrides
    BaseSlider<float, float>.InvokeValueChangedCallbacks()

    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
    BaseSlider<float, float>.ParseStringToValue(string, out float)

    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
    BaseSlider<float, float>.SetValueWithoutNotify(float)

    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
    BaseSlider<float, float>.SliderLerpUnclamped(float, float, float)

    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
    Overrides
    BaseSlider<float, float>.SliderNormalizeValue(float, float, float)

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IInputElement<TValueType>
    IValidatableElement<TValueType>
    INotifyValueChanging<TValueType>
    INotifyValueChanged<T>

    Extension Methods

    NotifyValueChangingExtensions.RegisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    NotifyValueChangingExtensions.UnregisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)