pub struct ColorPicker4<'ui, 'a, Label, Color> { /* private fields */ }
Expand description
§Examples
if ui.color_picker4("color_picker", &mut color) {
println!("A color was picked");
}
Implementations§
Source§impl<'ui, 'a, Label, Color> ColorPicker4<'ui, 'a, Label, Color>
impl<'ui, 'a, Label, Color> ColorPicker4<'ui, 'a, Label, Color>
Sourcepub fn new(
ui: &'ui Ui,
label: Label,
value: &'a mut Color,
) -> ColorPicker4<'ui, 'a, Label, Color>
👎Deprecated since 0.9.0: Use ui.color_picker4(...)
instead
pub fn new( ui: &'ui Ui, label: Label, value: &'a mut Color, ) -> ColorPicker4<'ui, 'a, Label, Color>
ui.color_picker4(...)
insteadConstructs a new color picker builder.
Sourcepub fn flags(self, flags: ColorEditFlags) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn flags(self, flags: ColorEditFlags) -> ColorPicker4<'ui, 'a, Label, Color>
Replaces all current settings with the given flags.
Sourcepub fn alpha(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn alpha(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables the use of the alpha component.
Sourcepub fn options(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn options(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables toggling of the options menu when right-clicking on inputs or the small preview.
Sourcepub fn small_preview(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn small_preview(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables the colored square preview next to the inputs.
Sourcepub fn inputs(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn inputs(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables the input sliders/text widgets.
Sourcepub fn tooltip(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn tooltip(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables the tooltip that appears when hovering the preview.
Sourcepub fn label(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn label(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables display of the inline text label (the label is in any case forwarded to the tooltip and picker).
Sourcepub fn side_preview(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn side_preview(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables the bigger color preview on the right side of the picker.
Sourcepub fn alpha_bar(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn alpha_bar(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables the vertical alpha bar/gradient in the color picker.
Sourcepub fn preview(
self,
preview: ColorPreview,
) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn preview( self, preview: ColorPreview, ) -> ColorPicker4<'ui, 'a, Label, Color>
Sets the preview style.
Sourcepub fn input_mode(
self,
input_mode: ColorEditInputMode,
) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn input_mode( self, input_mode: ColorEditInputMode, ) -> ColorPicker4<'ui, 'a, Label, Color>
Sets the data format for input and output data.
Sourcepub fn display_rgb(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn display_rgb(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables displaying the value as RGB.
Sourcepub fn display_hsv(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn display_hsv(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables displaying the value as HSV.
Sourcepub fn display_hex(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn display_hex(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>
Enables/disables displaying the value as hex.
Sourcepub fn mode(self, mode: ColorPickerMode) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn mode(self, mode: ColorPickerMode) -> ColorPicker4<'ui, 'a, Label, Color>
Sets the hue/saturation/value editor mode.
Sourcepub fn format(self, format: ColorFormat) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn format(self, format: ColorFormat) -> ColorPicker4<'ui, 'a, Label, Color>
Sets the formatting style of color components.
Sourcepub fn reference_color(
self,
ref_color: impl Into<Vector4<f32>>,
) -> ColorPicker4<'ui, 'a, Label, Color>
pub fn reference_color( self, ref_color: impl Into<Vector4<f32>>, ) -> ColorPicker4<'ui, 'a, Label, Color>
Sets the shown reference color.
Trait Implementations§
Auto Trait Implementations§
impl<'ui, 'a, Label, Color> Freeze for ColorPicker4<'ui, 'a, Label, Color>where
Label: Freeze,
impl<'ui, 'a, Label, Color> !RefUnwindSafe for ColorPicker4<'ui, 'a, Label, Color>
impl<'ui, 'a, Label, Color> !Send for ColorPicker4<'ui, 'a, Label, Color>
impl<'ui, 'a, Label, Color> !Sync for ColorPicker4<'ui, 'a, Label, Color>
impl<'ui, 'a, Label, Color> Unpin for ColorPicker4<'ui, 'a, Label, Color>where
Label: Unpin,
impl<'ui, 'a, Label, Color> !UnwindSafe for ColorPicker4<'ui, 'a, Label, Color>
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