ColorSlider
struct · ferroui-controls-color-picker · v0.5.0
struct ColorSlider
A slider with a background that represents a single color component.
Members
TYPEto_refon_color_changedPC_DARK_SELECTORPC_LIGHT_SELECTORPSEUDO_CLASSESconstructnewcolor_changedignore_property_changedset_ignore_property_changedcolor_propertycolor_component_propertycolor_model_propertyhsv_color_propertyis_alpha_visible_propertyis_perceptive_propertyis_rounding_enabled_propertycolorset_colorcolor_componentset_color_componentcolor_modelset_color_modelhsv_colorset_hsv_coloris_alpha_visibleset_is_alpha_visibleis_perceptiveset_is_perceptiveis_rounding_enabledset_is_rounding_enabled
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ColorSlider>
Returns a strong reference to this object.
on_color_changed
fn on_color_changed(self: &Self, e: &ColorChangedEventArgs)
Raises the color changed event.
e defines the old/new colors.
PC_DARK_SELECTOR
const PC_DARK_SELECTOR: &'static str
The pseudo-class of a dark selector thumb.
PC_LIGHT_SELECTOR
const PC_LIGHT_SELECTOR: &'static str
The pseudo-class of a light selector thumb.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudo-classes set by the class.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the ColorSlider 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 slider 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_component_property
fn color_component_property() -> &'static StyledProperty<ColorComponent>
Defines the ColorComponent property.
color_model_property
fn color_model_property() -> &'static StyledProperty<ColorModel>
Defines the ColorModel property.
hsv_color_property
fn hsv_color_property() -> &'static StyledProperty<HsvColor>
Defines the HsvColor property.
is_alpha_visible_property
fn is_alpha_visible_property() -> &'static StyledProperty<bool>
Defines the IsAlphaVisible property.
is_perceptive_property
fn is_perceptive_property() -> &'static StyledProperty<bool>
Defines the IsPerceptive property.
is_rounding_enabled_property
fn is_rounding_enabled_property() -> &'static StyledProperty<bool>
Defines the IsRoundingEnabled property.
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.
set_color
fn set_color(self: &Self, value: Color)
Sets color.
color_component
fn color_component(self: &Self) -> ColorComponent
Gets the color component represented by the slider.
set_color_component
fn set_color_component(self: &Self, value: ColorComponent)
Sets color_component.
color_model
fn color_model(self: &Self) -> ColorModel
Gets the active color model used by the slider.
set_color_model
fn set_color_model(self: &Self, value: ColorModel)
Sets color_model.
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.
set_hsv_color
fn set_hsv_color(self: &Self, value: HsvColor)
Sets hsv_color.
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.
set_is_alpha_visible
fn set_is_alpha_visible(self: &Self, value: bool)
Sets is_alpha_visible.
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.
set_is_perceptive
fn set_is_perceptive(self: &Self, value: bool)
Sets is_perceptive.
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.
set_is_rounding_enabled
fn set_is_rounding_enabled(self: &Self, value: bool)
Sets is_rounding_enabled.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherTemplatedControlImplExtControlImplExtSliderImplExtDerefUpcast<T>Upcast<ColorSlider>StaticTypeObjectTypeSubclassable<T>StyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplControlImplTemplatedControlImplSliderImplDefaultConstructibleFerroObjectImplColorSliderImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.