pub struct Picker<'ui> { /* private fields */ }Expand description
A button that opens a color picker dialog.
Implementations§
source§impl<'ui> Picker<'ui>
impl<'ui> Picker<'ui>
sourcepub fn selected_color(&self) -> Color
pub fn selected_color(&self) -> Color
The color currently selected by this picker.
sourcepub fn select_color(&self, color: Color)
pub fn select_color(&self, color: Color)
Selects the given color.
Panics
Panics if any components of color are not normalized to the [0.0, 1.0] range. See
[select_color_unchecked] for an unchecked version of this function.
sourcepub unsafe fn select_color_unchecked(&self, color: Color)
pub unsafe fn select_color_unchecked(&self, color: Color)
Selects the given color without first checking if it is valid.
Safety
All components of color must be normalized to the [0.0, 1.0] range.
sourcepub fn on_selected<F>(&'ui self, f: F)where
F: 'ui + FnMut(),
pub fn on_selected<F>(&'ui self, f: F)where F: 'ui + FnMut(),
Sets a callback for when the user selects a new color.
This callback is unset by default. This is not activated when
select_color or
select_color_unchecked is called.
Methods from Deref<Target = Control>§
sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Determines if this control is visible.
Controls are visible by default except for Windows, which are invisible
by default.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Determines if this control responds to user interaction.
Controls are enabled by default.
sourcepub fn is_enabled_to_user(&self) -> bool
pub fn is_enabled_to_user(&self) -> bool
Determines if this control, and all of its parent controls, are enabled.
If this control is not a child of a parent control, then this function is equivalent to
is_enabled.
sourcepub fn native_handle(&self) -> *mut c_void
pub fn native_handle(&self) -> *mut c_void
A handle to the underlying OS object.