FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ColorView

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

    struct ColorView
    

    Presents a color for user editing using a spectrum, palette and component sliders.

    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<ColorView>
    

    Returns a strong reference to this object.

    Source

    validate_selection

    fn validate_selection(self: &Self)
    

    Obsolete. No-op. This method is no longer used and will be removed in a future release (the necessary validation is now handled by the tab control).

    This method does nothing and should not be overridden or relied upon.

    Source

    on_color_changed

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

    Raises the color changed event.

    e defines the old/new colors.

    Source

    on_coerce_color

    fn on_coerce_color(self: &Self, value: Color) -> Color
    

    Called when the Color property has to be coerced; returns the coerced value.

    Source

    on_coerce_hsv_color

    fn on_coerce_hsv_color(self: &Self, value: HsvColor) -> HsvColor
    

    Called when the HsvColor property has to be coerced; returns the coerced value.

    Source

    TEMPLATE_PARTS

    const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
    

    The named parts expected in the control template.

    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 ColorView 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 view 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_model_property

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

    Defines the ColorModel property.

    Source

    color_spectrum_components_property

    fn color_spectrum_components_property() -> &'static StyledProperty<ColorSpectrumComponents>
    

    Defines the ColorSpectrumComponents property.

    Source

    color_spectrum_shape_property

    fn color_spectrum_shape_property() -> &'static StyledProperty<ColorSpectrumShape>
    

    Defines the ColorSpectrumShape property.

    Source

    hex_input_alpha_position_property

    fn hex_input_alpha_position_property() -> &'static StyledProperty<AlphaComponentPosition>
    

    Defines the HexInputAlphaPosition property.

    Source

    hsv_color_property

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

    Defines the HsvColor property.

    Source

    is_accent_colors_visible_property

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

    Defines the IsAccentColorsVisible property.

    Source

    is_alpha_enabled_property

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

    Defines the IsAlphaEnabled property.

    Source

    is_alpha_visible_property

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

    Defines the IsAlphaVisible property.

    Source

    is_color_components_visible_property

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

    Defines the IsColorComponentsVisible property.

    Source

    is_color_model_visible_property

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

    Defines the IsColorModelVisible property.

    Source

    is_color_palette_visible_property

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

    Defines the IsColorPaletteVisible property.

    Source

    is_color_preview_visible_property

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

    Defines the IsColorPreviewVisible property.

    Source

    is_color_spectrum_visible_property

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

    Defines the IsColorSpectrumVisible property.

    Source

    is_color_spectrum_slider_visible_property

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

    Defines the IsColorSpectrumSliderVisible property.

    Source

    is_component_slider_visible_property

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

    Defines the IsComponentSliderVisible property.

    Source

    is_component_text_input_visible_property

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

    Defines the IsComponentTextInputVisible property.

    Source

    is_hex_input_visible_property

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

    Defines the IsHexInputVisible property.

    Source

    max_hue_property

    fn max_hue_property() -> &'static StyledProperty<i32>
    

    Defines the MaxHue property.

    Source

    max_saturation_property

    fn max_saturation_property() -> &'static StyledProperty<i32>
    

    Defines the MaxSaturation property.

    Source

    max_value_property

    fn max_value_property() -> &'static StyledProperty<i32>
    

    Defines the MaxValue property.

    Source

    min_hue_property

    fn min_hue_property() -> &'static StyledProperty<i32>
    

    Defines the MinHue property.

    Source

    min_saturation_property

    fn min_saturation_property() -> &'static StyledProperty<i32>
    

    Defines the MinSaturation property.

    Source

    min_value_property

    fn min_value_property() -> &'static StyledProperty<i32>
    

    Defines the MinValue property.

    Source

    palette_colors_property

    fn palette_colors_property() -> &'static StyledProperty<Option<FerroList<Color>>>
    

    Defines the PaletteColors property.

    Source

    palette_column_count_property

    fn palette_column_count_property() -> &'static StyledProperty<i32>
    

    Defines the PaletteColumnCount property.

    Source

    palette_property

    fn palette_property() -> &'static StyledProperty<Option<Rc<dyn IColorPalette>>>
    

    Defines the Palette property.

    Source

    selected_index_property

    fn selected_index_property() -> &'static StyledProperty<i32>
    

    Defines the SelectedIndex property.

    Source

    color

    fn color(self: &Self) -> Color
    

    See ColorSpectrum::color.

    Source

    set_color

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

    Sets color.

    Source

    color_model

    fn color_model(self: &Self) -> ColorModel
    

    See ColorSlider::color_model.

    This property is only applicable to the components tab. The spectrum tab must always be in HSV and the palette tab contains only pre-defined colors.

    Source

    set_color_model

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

    Sets color_model.

    Source

    color_spectrum_components

    fn color_spectrum_components(self: &Self) -> ColorSpectrumComponents
    

    See ColorSpectrum::components.

    Source

    set_color_spectrum_components

    fn set_color_spectrum_components(self: &Self, value: ColorSpectrumComponents)
    

    Sets color_spectrum_components.

    Source

    color_spectrum_shape

    fn color_spectrum_shape(self: &Self) -> ColorSpectrumShape
    

    See ColorSpectrum::shape.

    Source

    set_color_spectrum_shape

    fn set_color_spectrum_shape(self: &Self, value: ColorSpectrumShape)
    

    Sets color_spectrum_shape.

    Source

    hex_input_alpha_position

    fn hex_input_alpha_position(self: &Self) -> AlphaComponentPosition
    

    Gets the position of the alpha component in the hexadecimal input box relative to all other color components.

    Source

    set_hex_input_alpha_position

    fn set_hex_input_alpha_position(self: &Self, value: AlphaComponentPosition)
    

    Sets hex_input_alpha_position.

    Source

    hsv_color

    fn hsv_color(self: &Self) -> HsvColor
    

    See ColorSpectrum::hsv_color.

    Source

    set_hsv_color

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

    Sets hsv_color.

    Source

    is_accent_colors_visible

    fn is_accent_colors_visible(self: &Self) -> bool
    

    See ColorPreviewer::is_accent_colors_visible.

    Source

    set_is_accent_colors_visible

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

    Sets is_accent_colors_visible.

    Source

    is_alpha_enabled

    fn is_alpha_enabled(self: &Self) -> bool
    

    Gets a value indicating whether the alpha component is enabled. When disabled (set to false) the alpha component will be fixed to maximum and editing controls disabled.

    Source

    set_is_alpha_enabled

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

    Sets is_alpha_enabled.

    Source

    is_alpha_visible

    fn is_alpha_visible(self: &Self) -> bool
    

    Gets a value indicating whether the alpha component editing controls (Slider(s) and TextBox) are visible. When hidden, the existing alpha component value is maintained.

    Note that is_component_text_input_visible also controls the alpha component TextBox visibility.

    Source

    set_is_alpha_visible

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

    Sets is_alpha_visible.

    Source

    is_color_components_visible

    fn is_color_components_visible(self: &Self) -> bool
    

    Gets a value indicating whether the color components tab/panel/page (subview) is visible.

    Source

    set_is_color_components_visible

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

    Sets is_color_components_visible.

    Source

    is_color_model_visible

    fn is_color_model_visible(self: &Self) -> bool
    

    Gets a value indicating whether the active color model indicator/selector is visible.

    Source

    set_is_color_model_visible

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

    Sets is_color_model_visible.

    Source

    is_color_palette_visible

    fn is_color_palette_visible(self: &Self) -> bool
    

    Gets a value indicating whether the color palette tab/panel/page (subview) is visible.

    Source

    set_is_color_palette_visible

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

    Sets is_color_palette_visible.

    Source

    is_color_preview_visible

    fn is_color_preview_visible(self: &Self) -> bool
    

    Gets a value indicating whether the color preview is visible.

    Note that accent color visibility is controlled separately by is_accent_colors_visible.

    Source

    set_is_color_preview_visible

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

    Sets is_color_preview_visible.

    Source

    is_color_spectrum_visible

    fn is_color_spectrum_visible(self: &Self) -> bool
    

    Gets a value indicating whether the color spectrum tab/panel/page (subview) is visible.

    Source

    set_is_color_spectrum_visible

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

    Sets is_color_spectrum_visible.

    Source

    is_color_spectrum_slider_visible

    fn is_color_spectrum_slider_visible(self: &Self) -> bool
    

    Gets a value indicating whether the color spectrum's third component slider is visible.

    Source

    set_is_color_spectrum_slider_visible

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

    Sets is_color_spectrum_slider_visible.

    Source

    is_component_slider_visible

    fn is_component_slider_visible(self: &Self) -> bool
    

    Gets a value indicating whether color component sliders are visible.

    All color components are controlled by this property but alpha can also be controlled with is_alpha_visible.

    Source

    set_is_component_slider_visible

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

    Sets is_component_slider_visible.

    Source

    is_component_text_input_visible

    fn is_component_text_input_visible(self: &Self) -> bool
    

    Gets a value indicating whether color component text inputs are visible.

    All color components are controlled by this property but alpha can also be controlled with is_alpha_visible.

    Source

    set_is_component_text_input_visible

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

    Sets is_component_text_input_visible.

    Source

    is_hex_input_visible

    fn is_hex_input_visible(self: &Self) -> bool
    

    Gets a value indicating whether the hexadecimal color value text input is visible.

    Source

    set_is_hex_input_visible

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

    Sets is_hex_input_visible.

    Source

    max_hue

    fn max_hue(self: &Self) -> i32
    

    See ColorSpectrum::max_hue.

    Source

    set_max_hue

    fn set_max_hue(self: &Self, value: i32)
    

    Sets max_hue.

    Source

    max_saturation

    fn max_saturation(self: &Self) -> i32
    

    See ColorSpectrum::max_saturation.

    Source

    set_max_saturation

    fn set_max_saturation(self: &Self, value: i32)
    

    Sets max_saturation.

    Source

    max_value

    fn max_value(self: &Self) -> i32
    

    See ColorSpectrum::max_value.

    Source

    set_max_value

    fn set_max_value(self: &Self, value: i32)
    

    Sets max_value.

    Source

    min_hue

    fn min_hue(self: &Self) -> i32
    

    See ColorSpectrum::min_hue.

    Source

    set_min_hue

    fn set_min_hue(self: &Self, value: i32)
    

    Sets min_hue.

    Source

    min_saturation

    fn min_saturation(self: &Self) -> i32
    

    See ColorSpectrum::min_saturation.

    Source

    set_min_saturation

    fn set_min_saturation(self: &Self, value: i32)
    

    Sets min_saturation.

    Source

    min_value

    fn min_value(self: &Self) -> i32
    

    See ColorSpectrum::min_value.

    Source

    set_min_value

    fn set_min_value(self: &Self, value: i32)
    

    Sets min_value.

    Source

    palette_colors

    fn palette_colors(self: &Self) -> Option<FerroList<Color>>
    

    Gets the collection of individual colors in the palette.

    This is not commonly set manually. Instead, it should be set automatically by providing an IColorPalette to the palette property.

    Also note that this property is what should be bound in the control template. palette is too high-level to use on its own.

    Source

    set_palette_colors

    fn set_palette_colors(self: &Self, value: Option<FerroList<Color>>)
    

    Sets palette_colors.

    Source

    palette_column_count

    fn palette_column_count(self: &Self) -> i32
    

    Gets the number of colors in each row (section) of the color palette. Within a standard palette, rows are shades and columns are colors.

    This is not commonly set manually. Instead, it should be set automatically by providing an IColorPalette to the palette property.

    Also note that this property is what should be bound in the control template. palette is too high-level to use on its own.

    Source

    set_palette_column_count

    fn set_palette_column_count(self: &Self, value: i32)
    

    Sets palette_column_count.

    Source

    palette

    fn palette(self: &Self) -> Option<Rc<dyn IColorPalette>>
    

    Gets the color palette.

    This will automatically set both palette_colors and palette_column_count overwriting any existing values.

    Source

    set_palette

    fn set_palette(self: &Self, value: Option<Rc<dyn IColorPalette>>)
    

    Sets palette.

    Source

    selected_index

    fn selected_index(self: &Self) -> i32
    

    Gets the index of the selected tab/panel/page (subview).

    When using the default control theme, this property is designed to be used with the ColorViewTab enum. The ColorViewTab enum defines the index values of each of the three standard tabs. Use like set_selected_index(ColorViewTab::Palette as i32).

    Source

    set_selected_index

    fn set_selected_index(self: &Self, value: i32)
    

    Sets selected_index.

    Source

    Trait implementations

    Availability

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