pub struct ColorEdit3<'ui, 'a, Label, C> { /* private fields */ }
Expand description
Builder for a color editor widget.
§Examples
if ui.color_edit4("color_edit", &mut color) {
println!("The color was changed");
}
Implementations§
Source§impl<'ui, 'a, Label, C> ColorEdit3<'ui, 'a, Label, C>
impl<'ui, 'a, Label, C> ColorEdit3<'ui, 'a, Label, C>
Sourcepub fn new(
ui: &'ui Ui,
label: Label,
value: &'a mut C,
) -> ColorEdit3<'ui, 'a, Label, C>
👎Deprecated since 0.9.0: Use ui.color_edit3(...)
instead
pub fn new( ui: &'ui Ui, label: Label, value: &'a mut C, ) -> ColorEdit3<'ui, 'a, Label, C>
ui.color_edit3(...)
insteadConstructs a new color editor builder.
Sourcepub fn flags(self, flags: ColorEditFlags) -> ColorEdit3<'ui, 'a, Label, C>
pub fn flags(self, flags: ColorEditFlags) -> ColorEdit3<'ui, 'a, Label, C>
Replaces all current settings with the given flags.
Sourcepub fn alpha(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn alpha(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables the use of the alpha component.
Sourcepub fn picker(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn picker(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables the picker that appears when clicking on colored square.
Sourcepub fn options(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn options(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables toggling of the options menu when right-clicking on inputs or the small preview.
Sourcepub fn small_preview(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn small_preview(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables the colored square preview next to the inputs.
Sourcepub fn inputs(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn inputs(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables the input sliders/text widgets.
Sourcepub fn tooltip(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn tooltip(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables the tooltip that appears when hovering the preview.
Sourcepub fn label(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn label(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables display of the inline text label (the label is in any case forwarded to the tooltip and picker).
Sourcepub fn alpha_bar(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn alpha_bar(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
Enables/disables the vertical alpha bar/gradient in the color picker.
Sourcepub fn preview(self, preview: ColorPreview) -> ColorEdit3<'ui, 'a, Label, C>
pub fn preview(self, preview: ColorPreview) -> ColorEdit3<'ui, 'a, Label, C>
Sets the preview style.
Sourcepub fn hdr(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
pub fn hdr(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>
(WIP) Currently only disables 0.0..1.0 limits in RGBA edition.
Note: you probably want to use ColorFormat::Float as well.
Sourcepub fn input_mode(
self,
input_mode: ColorEditInputMode,
) -> ColorEdit3<'ui, 'a, Label, C>
pub fn input_mode( self, input_mode: ColorEditInputMode, ) -> ColorEdit3<'ui, 'a, Label, C>
Sets the data format for input and output data.
Sourcepub fn display_mode(
self,
mode: ColorEditDisplayMode,
) -> ColorEdit3<'ui, 'a, Label, C>
pub fn display_mode( self, mode: ColorEditDisplayMode, ) -> ColorEdit3<'ui, 'a, Label, C>
Sets the color editor display mode.
Sourcepub fn format(self, format: ColorFormat) -> ColorEdit3<'ui, 'a, Label, C>
pub fn format(self, format: ColorFormat) -> ColorEdit3<'ui, 'a, Label, C>
Sets the formatting style of color components.
Trait Implementations§
Auto Trait Implementations§
impl<'ui, 'a, Label, C> Freeze for ColorEdit3<'ui, 'a, Label, C>where
Label: Freeze,
impl<'ui, 'a, Label, C> !RefUnwindSafe for ColorEdit3<'ui, 'a, Label, C>
impl<'ui, 'a, Label, C> !Send for ColorEdit3<'ui, 'a, Label, C>
impl<'ui, 'a, Label, C> !Sync for ColorEdit3<'ui, 'a, Label, C>
impl<'ui, 'a, Label, C> Unpin for ColorEdit3<'ui, 'a, Label, C>where
Label: Unpin,
impl<'ui, 'a, Label, C> !UnwindSafe for ColorEdit3<'ui, 'a, Label, C>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more