FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ColorSlider

    struct · ferroui-controls-color-picker · v0.5.0

    struct ColorSlider
    

    A slider with a background that represents a single color component.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ColorSlider>
    

    Returns a strong reference to this object.

    Source

    on_color_changed

    fn on_color_changed(self: &Self, e: &ColorChangedEventArgs)
    

    Raises the color changed event.

    e defines the old/new colors.

    Source

    PC_DARK_SELECTOR

    const PC_DARK_SELECTOR: &'static str
    

    The pseudo-class of a dark selector thumb.

    Source

    PC_LIGHT_SELECTOR

    const PC_LIGHT_SELECTOR: &'static str
    

    The pseudo-class of a light selector thumb.

    Source

    PSEUDO_CLASSES

    const PSEUDO_CLASSES: PseudoClassesAttribute
    

    The pseudo-classes set by the class.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the ColorSlider class.

    Source

    color_changed

    fn color_changed(self: &Self, handler: impl Fn(&ColorChangedEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
    

    Event for when the selected color changes within the slider. Disposing the returned handle unsubscribes.

    Source

    ignore_property_changed

    fn ignore_property_changed(self: &Self) -> bool
    

    Whether property changes are ignored while the slider updates its own properties (a protected field of the original).

    Source

    set_ignore_property_changed

    fn set_ignore_property_changed(self: &Self, value: bool)
    

    Sets ignore_property_changed.

    Source

    color_property

    fn color_property() -> &'static StyledProperty<Color>
    

    Defines the Color property.

    Source

    color_component_property

    fn color_component_property() -> &'static StyledProperty<ColorComponent>
    

    Defines the ColorComponent property.

    Source

    color_model_property

    fn color_model_property() -> &'static StyledProperty<ColorModel>
    

    Defines the ColorModel property.

    Source

    hsv_color_property

    fn hsv_color_property() -> &'static StyledProperty<HsvColor>
    

    Defines the HsvColor property.

    Source

    is_alpha_visible_property

    fn is_alpha_visible_property() -> &'static StyledProperty<bool>
    

    Defines the IsAlphaVisible property.

    Source

    is_perceptive_property

    fn is_perceptive_property() -> &'static StyledProperty<bool>
    

    Defines the IsPerceptive property.

    Source

    is_rounding_enabled_property

    fn is_rounding_enabled_property() -> &'static StyledProperty<bool>
    

    Defines the IsRoundingEnabled property.

    Source

    color

    fn color(self: &Self) -> Color
    

    Gets the currently selected color in the RGB color model.

    Use this property instead of hsv_color when in ColorModel::Rgba to avoid loss of precision and color drifting.

    Source

    set_color

    fn set_color(self: &Self, value: Color)
    

    Sets color.

    Source

    color_component

    fn color_component(self: &Self) -> ColorComponent
    

    Gets the color component represented by the slider.

    Source

    set_color_component

    fn set_color_component(self: &Self, value: ColorComponent)
    

    Sets color_component.

    Source

    color_model

    fn color_model(self: &Self) -> ColorModel
    

    Gets the active color model used by the slider.

    Source

    set_color_model

    fn set_color_model(self: &Self, value: ColorModel)
    

    Sets color_model.

    Source

    hsv_color

    fn hsv_color(self: &Self) -> HsvColor
    

    Gets the currently selected color in the HSV color model.

    Use this property instead of color when in ColorModel::Hsva to avoid loss of precision and color drifting.

    Source

    set_hsv_color

    fn set_hsv_color(self: &Self, value: HsvColor)
    

    Sets hsv_color.

    Source

    is_alpha_visible

    fn is_alpha_visible(self: &Self) -> bool
    

    Gets a value indicating whether the alpha component is visible and rendered. When false, this ensures that the gradient is always visible and never transparent regardless of the actual color. This property is ignored when the alpha component itself is being displayed.

    Setting to false means the alpha component is always forced to maximum for components other than color_component during rendering. This doesn't change the value of the alpha component in the color – it is only for display.

    Source

    set_is_alpha_visible

    fn set_is_alpha_visible(self: &Self, value: bool)
    

    Sets is_alpha_visible.

    Source

    is_perceptive

    fn is_perceptive(self: &Self) -> bool
    

    Gets a value indicating whether the slider adapts rendering to improve user-perception over exactness.

    When true in the HSVA color model, this ensures that the gradient is always visible and never washed out regardless of the actual color. When true in the RGBA color model, this ensures the gradient always appears as red, green or blue.

    For example, with Hue in the HSVA color model, the Saturation and Value components are always forced to maximum values during rendering. In the RGBA color model, all components other than color_component are forced to minimum values during rendering.

    Note this property will only adjust components other than color_component during rendering. This also doesn't change the values of any components in the actual color – it is only for display.

    Source

    set_is_perceptive

    fn set_is_perceptive(self: &Self, value: bool)
    

    Sets is_perceptive.

    Source

    is_rounding_enabled

    fn is_rounding_enabled(self: &Self) -> bool
    

    Gets a value indicating whether rounding of color component values is enabled.

    This is applicable for the HSV color model only. The HsvColor struct uses double values while the Color struct uses byte. Only double types need rounding.

    Source

    set_is_rounding_enabled

    fn set_is_rounding_enabled(self: &Self, value: bool)
    

    Sets is_rounding_enabled.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.