Struct ColorEdit3

Source
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>
where Label: AsRef<str>, C: Copy + Into<Vector3<f32>>, Vector3<f32>: Into<C> + Into<[f32; 3]>,

Source

pub 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

Constructs a new color editor builder.

Source

pub fn flags(self, flags: ColorEditFlags) -> ColorEdit3<'ui, 'a, Label, C>

Replaces all current settings with the given flags.

Source

pub fn alpha(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>

Enables/disables the use of the alpha component.

Source

pub fn picker(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>

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

Source

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.

Source

pub fn small_preview(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>

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

Source

pub fn inputs(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>

Enables/disables the input sliders/text widgets.

Source

pub fn tooltip(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>

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

Source

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

Source

pub fn alpha_bar(self, value: bool) -> ColorEdit3<'ui, 'a, Label, C>

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

Source

pub fn preview(self, preview: ColorPreview) -> ColorEdit3<'ui, 'a, Label, C>

Sets the preview style.

Source

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.

Source

pub fn input_mode( self, input_mode: ColorEditInputMode, ) -> ColorEdit3<'ui, 'a, Label, C>

Sets the data format for input and output data.

Source

pub fn display_mode( self, mode: ColorEditDisplayMode, ) -> ColorEdit3<'ui, 'a, Label, C>

Sets the color editor display mode.

Source

pub fn format(self, format: ColorFormat) -> ColorEdit3<'ui, 'a, Label, C>

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, Label, C> Debug for ColorEdit3<'ui, 'a, Label, C>
where Label: Debug, C: Debug,

Source§

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

Formats the value using the given formatter. Read more

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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

Source§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V