Struct imgui::ColorEdit4

source ·
pub struct ColorEdit4<'ui, 'a, T, 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, T, C> ColorEdit4<'ui, 'a, T, C>
where T: AsRef<str>, C: Copy + Into<Vector4<f32>>, Vector4<f32>: Into<C> + Into<[f32; 4]>,

source

pub fn new(ui: &'ui Ui, label: T, value: &'a mut C) -> Self

👎Deprecated since 0.9.0: Use ui.color_edit4(...) instead

Constructs a new color editor builder.

source

pub fn flags(self, flags: ColorEditFlags) -> Self

Replaces all current settings with the given flags.

source

pub fn alpha(self, value: bool) -> Self

Enables/disables the use of the alpha component.

source

pub fn picker(self, value: bool) -> Self

Enables/disables the picker that appears when clicking on colored square.

source

pub fn options(self, value: bool) -> Self

Enables/disables toggling of the options menu when right-clicking on inputs or the small preview.

source

pub fn small_preview(self, value: bool) -> Self

Enables/disables the colored square preview next to the inputs.

source

pub fn inputs(self, value: bool) -> Self

Enables/disables the input sliders/text widgets.

source

pub fn tooltip(self, value: bool) -> Self

Enables/disables the tooltip that appears when hovering the preview.

source

pub fn label(self, value: bool) -> Self

Enables/disables display of the inline text label (the label is in any case forwarded to the tooltip and picker).

source

pub fn alpha_bar(self, value: bool) -> Self

Enables/disables the vertical alpha bar/gradient in the color picker.

source

pub fn preview(self, preview: ColorPreview) -> Self

Sets the preview style.

source

pub fn hdr(self, value: bool) -> Self

(WIP) Currently only disables 0.0..1.0 limits in RGBA edition.

Note: you probably want to use ColorFormat::Float as well.

source

pub fn input_mode(self, input_mode: ColorEditInputMode) -> Self

Sets the data format for input and output data.

source

pub fn display_mode(self, mode: ColorEditDisplayMode) -> Self

Sets the color editor display mode.

source

pub fn format(self, format: ColorFormat) -> Self

Sets the formatting style of color components.

source

pub fn build(self) -> bool

Builds the color editor.

Returns true if the color value was changed.

Trait Implementations§

source§

impl<'ui, 'a, T: Debug, C: Debug> Debug for ColorEdit4<'ui, 'a, T, C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'ui, 'a, T, C> Freeze for ColorEdit4<'ui, 'a, T, C>
where T: Freeze,

§

impl<'ui, 'a, T, C> !RefUnwindSafe for ColorEdit4<'ui, 'a, T, C>

§

impl<'ui, 'a, T, C> !Send for ColorEdit4<'ui, 'a, T, C>

§

impl<'ui, 'a, T, C> !Sync for ColorEdit4<'ui, 'a, T, C>

§

impl<'ui, 'a, T, C> Unpin for ColorEdit4<'ui, 'a, T, C>
where T: Unpin,

§

impl<'ui, 'a, T, C> !UnwindSafe for ColorEdit4<'ui, 'a, T, C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.