ColorView
struct · ferroui-controls-color-picker · v0.5.0
struct ColorView
Presents a color for user editing using a spectrum, palette and component sliders.
Members
TYPEto_refvalidate_selectionon_color_changedon_coerce_coloron_coerce_hsv_colorTEMPLATE_PARTSconstructnewcolor_changedignore_property_changedset_ignore_property_changedcolor_propertycolor_model_propertycolor_spectrum_components_propertycolor_spectrum_shape_propertyhex_input_alpha_position_propertyhsv_color_propertyis_accent_colors_visible_propertyis_alpha_enabled_propertyis_alpha_visible_propertyis_color_components_visible_propertyis_color_model_visible_propertyis_color_palette_visible_propertyis_color_preview_visible_propertyis_color_spectrum_visible_propertyis_color_spectrum_slider_visible_propertyis_component_slider_visible_propertyis_component_text_input_visible_propertyis_hex_input_visible_propertymax_hue_propertymax_saturation_propertymax_value_propertymin_hue_propertymin_saturation_propertymin_value_propertypalette_colors_propertypalette_column_count_propertypalette_propertyselected_index_propertycolorset_colorcolor_modelset_color_modelcolor_spectrum_componentsset_color_spectrum_componentscolor_spectrum_shapeset_color_spectrum_shapehex_input_alpha_positionset_hex_input_alpha_positionhsv_colorset_hsv_coloris_accent_colors_visibleset_is_accent_colors_visibleis_alpha_enabledset_is_alpha_enabledis_alpha_visibleset_is_alpha_visibleis_color_components_visibleset_is_color_components_visibleis_color_model_visibleset_is_color_model_visibleis_color_palette_visibleset_is_color_palette_visibleis_color_preview_visibleset_is_color_preview_visibleis_color_spectrum_visibleset_is_color_spectrum_visibleis_color_spectrum_slider_visibleset_is_color_spectrum_slider_visibleis_component_slider_visibleset_is_component_slider_visibleis_component_text_input_visibleset_is_component_text_input_visibleis_hex_input_visibleset_is_hex_input_visiblemax_hueset_max_huemax_saturationset_max_saturationmax_valueset_max_valuemin_hueset_min_huemin_saturationset_min_saturationmin_valueset_min_valuepalette_colorsset_palette_colorspalette_column_countset_palette_column_countpaletteset_paletteselected_indexset_selected_index
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ColorView>
Returns a strong reference to this object.
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.
on_color_changed
fn on_color_changed(self: &Self, e: &ColorChangedEventArgs)
Raises the color changed event.
e defines the old/new colors.
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.
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.
TEMPLATE_PARTS
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
The named parts expected in the control template.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the ColorView class.
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.
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).
set_ignore_property_changed
fn set_ignore_property_changed(self: &Self, value: bool)
Sets ignore_property_changed.
color_property
fn color_property() -> &'static StyledProperty<Color>
Defines the Color property.
color_model_property
fn color_model_property() -> &'static StyledProperty<ColorModel>
Defines the ColorModel property.
color_spectrum_components_property
fn color_spectrum_components_property() -> &'static StyledProperty<ColorSpectrumComponents>
Defines the ColorSpectrumComponents property.
color_spectrum_shape_property
fn color_spectrum_shape_property() -> &'static StyledProperty<ColorSpectrumShape>
Defines the ColorSpectrumShape property.
hex_input_alpha_position_property
fn hex_input_alpha_position_property() -> &'static StyledProperty<AlphaComponentPosition>
Defines the HexInputAlphaPosition property.
hsv_color_property
fn hsv_color_property() -> &'static StyledProperty<HsvColor>
Defines the HsvColor property.
is_accent_colors_visible_property
fn is_accent_colors_visible_property() -> &'static StyledProperty<bool>
Defines the IsAccentColorsVisible property.
is_alpha_enabled_property
fn is_alpha_enabled_property() -> &'static StyledProperty<bool>
Defines the IsAlphaEnabled property.
is_alpha_visible_property
fn is_alpha_visible_property() -> &'static StyledProperty<bool>
Defines the IsAlphaVisible property.
is_color_components_visible_property
fn is_color_components_visible_property() -> &'static StyledProperty<bool>
Defines the IsColorComponentsVisible property.
is_color_model_visible_property
fn is_color_model_visible_property() -> &'static StyledProperty<bool>
Defines the IsColorModelVisible property.
is_color_palette_visible_property
fn is_color_palette_visible_property() -> &'static StyledProperty<bool>
Defines the IsColorPaletteVisible property.
is_color_preview_visible_property
fn is_color_preview_visible_property() -> &'static StyledProperty<bool>
Defines the IsColorPreviewVisible property.
is_color_spectrum_visible_property
fn is_color_spectrum_visible_property() -> &'static StyledProperty<bool>
Defines the IsColorSpectrumVisible property.
is_color_spectrum_slider_visible_property
fn is_color_spectrum_slider_visible_property() -> &'static StyledProperty<bool>
Defines the IsColorSpectrumSliderVisible property.
is_component_slider_visible_property
fn is_component_slider_visible_property() -> &'static StyledProperty<bool>
Defines the IsComponentSliderVisible property.
is_component_text_input_visible_property
fn is_component_text_input_visible_property() -> &'static StyledProperty<bool>
Defines the IsComponentTextInputVisible property.
is_hex_input_visible_property
fn is_hex_input_visible_property() -> &'static StyledProperty<bool>
Defines the IsHexInputVisible property.
max_hue_property
fn max_hue_property() -> &'static StyledProperty<i32>
Defines the MaxHue property.
max_saturation_property
fn max_saturation_property() -> &'static StyledProperty<i32>
Defines the MaxSaturation property.
max_value_property
fn max_value_property() -> &'static StyledProperty<i32>
Defines the MaxValue property.
min_hue_property
fn min_hue_property() -> &'static StyledProperty<i32>
Defines the MinHue property.
min_saturation_property
fn min_saturation_property() -> &'static StyledProperty<i32>
Defines the MinSaturation property.
min_value_property
fn min_value_property() -> &'static StyledProperty<i32>
Defines the MinValue property.
palette_colors_property
fn palette_colors_property() -> &'static StyledProperty<Option<FerroList<Color>>>
Defines the PaletteColors property.
palette_column_count_property
fn palette_column_count_property() -> &'static StyledProperty<i32>
Defines the PaletteColumnCount property.
palette_property
fn palette_property() -> &'static StyledProperty<Option<Rc<dyn IColorPalette>>>
Defines the Palette property.
selected_index_property
fn selected_index_property() -> &'static StyledProperty<i32>
Defines the SelectedIndex property.
color
fn color(self: &Self) -> Color
See ColorSpectrum::color.
set_color
fn set_color(self: &Self, value: Color)
Sets color.
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.
set_color_model
fn set_color_model(self: &Self, value: ColorModel)
Sets color_model.
color_spectrum_components
fn color_spectrum_components(self: &Self) -> ColorSpectrumComponents
See ColorSpectrum::components.
set_color_spectrum_components
fn set_color_spectrum_components(self: &Self, value: ColorSpectrumComponents)
Sets color_spectrum_components.
color_spectrum_shape
fn color_spectrum_shape(self: &Self) -> ColorSpectrumShape
See ColorSpectrum::shape.
set_color_spectrum_shape
fn set_color_spectrum_shape(self: &Self, value: ColorSpectrumShape)
Sets color_spectrum_shape.
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.
set_hex_input_alpha_position
fn set_hex_input_alpha_position(self: &Self, value: AlphaComponentPosition)
Sets hex_input_alpha_position.
hsv_color
fn hsv_color(self: &Self) -> HsvColor
See ColorSpectrum::hsv_color.
set_hsv_color
fn set_hsv_color(self: &Self, value: HsvColor)
Sets hsv_color.
is_accent_colors_visible
fn is_accent_colors_visible(self: &Self) -> bool
See ColorPreviewer::is_accent_colors_visible.
set_is_accent_colors_visible
fn set_is_accent_colors_visible(self: &Self, value: bool)
Sets is_accent_colors_visible.
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.
set_is_alpha_enabled
fn set_is_alpha_enabled(self: &Self, value: bool)
Sets is_alpha_enabled.
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.
set_is_alpha_visible
fn set_is_alpha_visible(self: &Self, value: bool)
Sets is_alpha_visible.
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.
set_is_color_components_visible
fn set_is_color_components_visible(self: &Self, value: bool)
Sets is_color_components_visible.
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.
set_is_color_model_visible
fn set_is_color_model_visible(self: &Self, value: bool)
Sets is_color_model_visible.
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.
set_is_color_palette_visible
fn set_is_color_palette_visible(self: &Self, value: bool)
Sets is_color_palette_visible.
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.
set_is_color_preview_visible
fn set_is_color_preview_visible(self: &Self, value: bool)
Sets is_color_preview_visible.
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.
set_is_color_spectrum_visible
fn set_is_color_spectrum_visible(self: &Self, value: bool)
Sets is_color_spectrum_visible.
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.
set_is_color_spectrum_slider_visible
fn set_is_color_spectrum_slider_visible(self: &Self, value: bool)
Sets is_color_spectrum_slider_visible.
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.
set_is_component_slider_visible
fn set_is_component_slider_visible(self: &Self, value: bool)
Sets is_component_slider_visible.
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.
set_is_component_text_input_visible
fn set_is_component_text_input_visible(self: &Self, value: bool)
Sets is_component_text_input_visible.
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.
set_is_hex_input_visible
fn set_is_hex_input_visible(self: &Self, value: bool)
Sets is_hex_input_visible.
max_hue
fn max_hue(self: &Self) -> i32
See ColorSpectrum::max_hue.
set_max_hue
fn set_max_hue(self: &Self, value: i32)
Sets max_hue.
max_saturation
fn max_saturation(self: &Self) -> i32
See ColorSpectrum::max_saturation.
set_max_saturation
fn set_max_saturation(self: &Self, value: i32)
Sets max_saturation.
max_value
fn max_value(self: &Self) -> i32
See ColorSpectrum::max_value.
set_max_value
fn set_max_value(self: &Self, value: i32)
Sets max_value.
min_hue
fn min_hue(self: &Self) -> i32
See ColorSpectrum::min_hue.
set_min_hue
fn set_min_hue(self: &Self, value: i32)
Sets min_hue.
min_saturation
fn min_saturation(self: &Self) -> i32
See ColorSpectrum::min_saturation.
set_min_saturation
fn set_min_saturation(self: &Self, value: i32)
Sets min_saturation.
min_value
fn min_value(self: &Self) -> i32
See ColorSpectrum::min_value.
set_min_value
fn set_min_value(self: &Self, value: i32)
Sets min_value.
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.
set_palette_colors
fn set_palette_colors(self: &Self, value: Option<FerroList<Color>>)
Sets palette_colors.
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.
set_palette_column_count
fn set_palette_column_count(self: &Self, value: i32)
Sets palette_column_count.
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.
set_palette
fn set_palette(self: &Self, value: Option<Rc<dyn IColorPalette>>)
Sets palette.
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).
set_selected_index
fn set_selected_index(self: &Self, value: i32)
Sets selected_index.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherTemplatedControlImplExtControlImplExtDerefUpcast<T>Upcast<ColorView>StaticTypeObjectTypeSubclassable<T>StyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplControlImplDefaultConstructibleFerroObjectImplTemplatedControlImplColorViewImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.