pub struct ColorDialog { /* private fields */ }
Expand description
Displays a modal dialog box that allows the user to choose a specific color value.
Implementations§
Source§impl ColorDialog
impl ColorDialog
pub fn builder() -> ColorDialogBuilder
Sourcepub fn run<C: Into<ControlHandle>>(&self, owner: Option<C>) -> bool
pub fn run<C: Into<ControlHandle>>(&self, owner: Option<C>) -> bool
Execute the color dialog.
This function will return true
if the user select a color or false
if the dialog is cancelled
Sourcepub fn color(&self) -> [u8; 3]
pub fn color(&self) -> [u8; 3]
Return the color choosen by the user. The returned color is a [r, g, b] array.
If the dialog was never executed, this returns [0, 0, 0]
(black);
Sourcepub fn set_saved_color(&self, index: usize, color: &[u8; 3])
pub fn set_saved_color(&self, index: usize, color: &[u8; 3])
Sets one of the saved color in the dialog. A dialog supports up to 16 colors (index: 0 to 15).
Panics: - If the index is out of bound
Sourcepub fn saved_color(&self, index: usize) -> [u8; 3]
pub fn saved_color(&self, index: usize) -> [u8; 3]
Returns one of the saved color in the dialog. A dialog supports up to 16 colors (index: 0 to 15).
Panics: - If the index is out of bound
Trait Implementations§
Source§impl Default for ColorDialog
impl Default for ColorDialog
Source§fn default() -> ColorDialog
fn default() -> ColorDialog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ColorDialog
impl !RefUnwindSafe for ColorDialog
impl !Send for ColorDialog
impl !Sync for ColorDialog
impl Unpin for ColorDialog
impl UnwindSafe for ColorDialog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more