Struct arcdps_imgui::ColorEdit
source · pub struct ColorEdit<'a, T: AsRef<str> + 'a> { /* private fields */ }
Expand description
Builder for a color editor widget.
§Examples
let ce = ColorEdit::new(im_str!("color_edit"), &mut color);
if ce.build(&ui) {
println!("The color was changed");
}
Implementations§
source§impl<'a, T: AsRef<str> + 'a> ColorEdit<'a, T>
impl<'a, T: AsRef<str> + 'a> ColorEdit<'a, T>
sourcepub fn new(label: T, value: impl Into<EditableColor<'a>>) -> ColorEdit<'a, T>
pub fn new(label: T, value: impl Into<EditableColor<'a>>) -> ColorEdit<'a, T>
Constructs a new color editor builder.
sourcepub fn flags(self, flags: ColorEditFlags) -> Self
pub fn flags(self, flags: ColorEditFlags) -> Self
Replaces all current settings with the given flags.
sourcepub fn picker(self, value: bool) -> Self
pub fn picker(self, value: bool) -> Self
Enables/disables the picker that appears when clicking on colored square.
sourcepub fn options(self, value: bool) -> Self
pub fn options(self, value: bool) -> Self
Enables/disables toggling of the options menu when right-clicking on inputs or the small preview.
sourcepub fn small_preview(self, value: bool) -> Self
pub fn small_preview(self, value: bool) -> Self
Enables/disables the colored square preview next to the inputs.
sourcepub fn tooltip(self, value: bool) -> Self
pub fn tooltip(self, value: bool) -> Self
Enables/disables the tooltip that appears when hovering the preview.
sourcepub fn label(self, value: bool) -> Self
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).
sourcepub fn alpha_bar(self, value: bool) -> Self
pub fn alpha_bar(self, value: bool) -> Self
Enables/disables the vertical alpha bar/gradient in the color picker.
sourcepub fn preview(self, preview: ColorPreview) -> Self
pub fn preview(self, preview: ColorPreview) -> Self
Sets the preview style.
sourcepub fn hdr(self, value: bool) -> Self
pub fn hdr(self, value: bool) -> Self
(WIP) Currently only disables 0.0..1.0 limits in RGBA edition.
Note: you probably want to use ColorFormat::Float as well.
sourcepub fn input_mode(self, input_mode: ColorEditInputMode) -> Self
pub fn input_mode(self, input_mode: ColorEditInputMode) -> Self
Sets the data format for input and output data.
sourcepub fn display_mode(self, mode: ColorEditDisplayMode) -> Self
pub fn display_mode(self, mode: ColorEditDisplayMode) -> Self
Sets the color editor display mode.
sourcepub fn format(self, format: ColorFormat) -> Self
pub fn format(self, format: ColorFormat) -> Self
Sets the formatting style of color components.