ColorPreviewer
struct · ferroui-controls-color-picker · v0.5.0
struct ColorPreviewer
Presents a preview color with optional accent colors.
Members
TYPEto_refon_color_changedTEMPLATE_PARTSconstructnewcolor_changedhsv_color_propertyis_accent_colors_visible_propertyhsv_colorset_hsv_coloris_accent_colors_visibleset_is_accent_colors_visible
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ColorPreviewer>
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.
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 ColorPreviewer 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 previewer. This occurs when an accent color is pressed. Disposing the returned handle unsubscribes.
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.
hsv_color
fn hsv_color(self: &Self) -> HsvColor
Gets the currently previewed color in the HSV color model.
Only an HSV color is supported in this control to ensure there is never any loss of precision or color information. Accent colors, like the color spectrum, only operate with the HSV color model.
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
Gets a value indicating whether accent colors are visible along with the preview color.
set_is_accent_colors_visible
fn set_is_accent_colors_visible(self: &Self, value: bool)
Sets is_accent_colors_visible.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherTemplatedControlImplExtControlImplExtDerefUpcast<T>Upcast<ColorPreviewer>StaticTypeObjectTypeSubclassable<T>StyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplControlImplDefaultConstructibleFerroObjectImplTemplatedControlImplColorPreviewerImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.