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> !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
§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U

Return the T [ShaderType] for self. When used in [AsBindGroup] derives, it is safe to assume that all images in self exist.
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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,