Struct 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, ) -> ColorPicker4<'ui, 'a, Label, Color>

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

Constructs a new color picker builder.

Source

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

Replaces all current settings with the given flags.

Source

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

Enables/disables the use of the alpha component.

Source

pub fn options(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>

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

Source

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

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

Source

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

Enables/disables the input sliders/text widgets.

Source

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

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

Source

pub fn label(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>

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) -> ColorPicker4<'ui, 'a, Label, Color>

Enables/disables the bigger color preview on the right side of the picker.

Source

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

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

Source

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

Sets the preview style.

Source

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

Sets the data format for input and output data.

Source

pub fn display_rgb(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>

Enables/disables displaying the value as RGB.

Source

pub fn display_hsv(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>

Enables/disables displaying the value as HSV.

Source

pub fn display_hex(self, value: bool) -> ColorPicker4<'ui, 'a, Label, Color>

Enables/disables displaying the value as hex.

Source

pub fn mode(self, mode: ColorPickerMode) -> ColorPicker4<'ui, 'a, Label, Color>

Sets the hue/saturation/value editor mode.

Source

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

Sets the formatting style of color components.

Source

pub fn reference_color( self, ref_color: impl Into<Vector4<f32>>, ) -> ColorPicker4<'ui, 'a, Label, Color>

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