[][src]Struct imgui::ColorEdit

#[must_use]pub struct ColorEdit<'a> { /* fields omitted */ }

Builder for a color editor widget.

Examples

let ce = ColorEdit::new(im_str!("color_edit"), &mut color);
if ce.build(&ui) {
  println!("The color was changed");
}

Implementations

impl<'a> ColorEdit<'a>[src]

pub fn new<T: Into<EditableColor<'a>>>(
    label: &'a ImStr,
    value: T
) -> ColorEdit<'a>
[src]

Constructs a new color editor builder.

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

Replaces all current settings with the given flags.

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

Enables/disables the use of the alpha component.

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

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

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

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

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

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

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

Enables/disables the input sliders/text widgets.

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

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

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

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

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

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

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

Sets the preview style.

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

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

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

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

Sets the data format for input and output data.

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

Sets the color editor display mode.

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

Sets the formatting style of color components.

pub fn build(self, _: &Ui) -> bool[src]

Builds the color editor.

Returns true if the color value was changed.

Trait Implementations

impl<'a> Debug for ColorEdit<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ColorEdit<'a>

impl<'a> Send for ColorEdit<'a>

impl<'a> Sync for ColorEdit<'a>

impl<'a> Unpin for ColorEdit<'a>

impl<'a> !UnwindSafe for ColorEdit<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.