Struct imgui::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>
impl<'ui, 'a, Label, Color> ColorPicker4<'ui, 'a, Label, Color>
sourcepub fn new(ui: &'ui Ui, label: Label, value: &'a mut Color) -> Self
👎Deprecated since 0.9.0: Use ui.color_picker4(...)
instead
pub fn new(ui: &'ui Ui, label: Label, value: &'a mut Color) -> Self
ui.color_picker4(...)
insteadConstructs 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: impl Into<Vector4<f32>>) -> Self
pub fn reference_color(self, ref_color: impl Into<Vector4<f32>>) -> Self
Sets the shown reference color.