Struct imgui::ColorPicker [−][src]
Builder for a color picker widget.
Examples
let cp = ColorPicker::new(im_str!("color_picker"), &mut color); if cp.build(&ui) { println!("A color was picked"); }
Implementations
impl<'a> ColorPicker<'a>
[src]
pub fn new<T: Into<EditableColor<'a>>>(
label: &'a ImStr,
value: T
) -> ColorPicker<'a>
[src]
label: &'a ImStr,
value: T
) -> ColorPicker<'a>
Constructs a new color picker builder.
pub fn flags(mut self: Self, flags: ColorEditFlags) -> Self
[src]
Replaces all current settings with the given flags.
pub fn alpha(mut self: Self, value: bool) -> Self
[src]
Enables/disables the use of the alpha component.
pub fn options(mut self: 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(mut self: Self, value: bool) -> Self
[src]
Enables/disables the colored square preview next to the inputs.
pub fn inputs(mut self: Self, value: bool) -> Self
[src]
Enables/disables the input sliders/text widgets.
pub fn tooltip(mut self: Self, value: bool) -> Self
[src]
Enables/disables the tooltip that appears when hovering the preview.
pub fn label(mut self: 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 side_preview(mut self: Self, value: bool) -> Self
[src]
Enables/disables the bigger color preview on the right side of the picker.
pub fn alpha_bar(mut self: Self, value: bool) -> Self
[src]
Enables/disables the vertical alpha bar/gradient in the color picker.
pub fn preview(mut self: Self, preview: ColorPreview) -> Self
[src]
Sets the preview style.
pub fn input_mode(mut self: Self, input_mode: ColorEditInputMode) -> Self
[src]
Sets the data format for input and output data.
pub fn display_rgb(mut self: Self, value: bool) -> Self
[src]
Enables/disables displaying the value as RGB.
pub fn display_hsv(mut self: Self, value: bool) -> Self
[src]
Enables/disables displaying the value as HSV.
pub fn display_hex(mut self: Self, value: bool) -> Self
[src]
Enables/disables displaying the value as hex.
pub fn mode(mut self: Self, mode: ColorPickerMode) -> Self
[src]
Sets the hue/saturation/value editor mode.
pub fn format(mut self: Self, format: ColorFormat) -> Self
[src]
Sets the formatting style of color components.
pub fn reference_color(mut self: Self, ref_color: &'a [f32; 4]) -> Self
[src]
Sets the shown reference color.
pub fn build(mut self: Self, _: &Ui<'_>) -> bool
[src]
Builds the color picker.
Returns true if the color value was changed.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for ColorPicker<'a>
[src]
impl<'a> Send for ColorPicker<'a>
[src]
impl<'a> Sync for ColorPicker<'a>
[src]
impl<'a> Unpin for ColorPicker<'a>
[src]
impl<'a> !UnwindSafe for ColorPicker<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,