Struct imgui::ColorPicker4

source ·
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>
where Label: AsRef<str>, Color: Copy + Into<Vector4<f32>>, Vector4<f32>: Into<Color> + Into<[f32; 4]>,

source

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

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

Constructs a new color picker 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 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 side_preview(self, value: bool) -> Self

Enables/disables the bigger color preview on the right side of the 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 input_mode(self, input_mode: ColorEditInputMode) -> Self

Sets the data format for input and output data.

source

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

Enables/disables displaying the value as RGB.

source

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

Enables/disables displaying the value as HSV.

source

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

Enables/disables displaying the value as hex.

source

pub fn mode(self, mode: ColorPickerMode) -> Self

Sets the hue/saturation/value editor mode.

source

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

Sets the formatting style of color components.

source

pub fn reference_color(self, ref_color: impl Into<Vector4<f32>>) -> Self

Sets the shown reference color.

source

pub fn build(self) -> bool

Builds the color picker.

Returns true if the color value was changed.

Trait Implementations§

source§

impl<'ui, 'a, Label: Debug, Color: Debug> Debug for ColorPicker4<'ui, 'a, Label, Color>

source§

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

Formats the value using the given formatter. Read more

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> 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.