Struct arcdps_imgui::ColorPicker
source · pub struct ColorPicker<'a, T: AsRef<str> + 'a> { /* private fields */ }
Expand description
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§
source§impl<'a, T: AsRef<str>> ColorPicker<'a, T>
impl<'a, T: AsRef<str>> ColorPicker<'a, T>
sourcepub fn new(label: T, value: impl Into<EditableColor<'a>>) -> Self
pub fn new(label: T, value: impl Into<EditableColor<'a>>) -> Self
Constructs a new color picker 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 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 side_preview(self, value: bool) -> Self
pub fn side_preview(self, value: bool) -> Self
Enables/disables the bigger color preview on the right side of the 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 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_rgb(self, value: bool) -> Self
pub fn display_rgb(self, value: bool) -> Self
Enables/disables displaying the value as RGB.
sourcepub fn display_hsv(self, value: bool) -> Self
pub fn display_hsv(self, value: bool) -> Self
Enables/disables displaying the value as HSV.
sourcepub fn display_hex(self, value: bool) -> Self
pub fn display_hex(self, value: bool) -> Self
Enables/disables displaying the value as hex.
sourcepub fn mode(self, mode: ColorPickerMode) -> Self
pub fn mode(self, mode: ColorPickerMode) -> Self
Sets the hue/saturation/value editor mode.
sourcepub fn format(self, format: ColorFormat) -> Self
pub fn format(self, format: ColorFormat) -> Self
Sets the formatting style of color components.
sourcepub fn reference_color(self, ref_color: &'a [f32; 4]) -> Self
pub fn reference_color(self, ref_color: &'a [f32; 4]) -> Self
Sets the shown reference color.