[][src]Module imgui_ext::color

color(...) docs.

It has three variants:

Color Button

color(button(...))

Optional params

  • label
  • flags Function identifier that returns a ImGuiColorEditFlags.
  • preview Allowed values: "Opaque", "HalfAlpha", "Alpha" (ColorPreview variants).
  • size Function identifier that returns the button size.
  • catch
  • map Applies a mapping function to &mut Self.

Color Edit

color(edit(...))

Optional params

  • label
  • flags Function identifier that returns a ImGuiColorEditFlags.
  • preview Allowed values: "Opaque", "HalfAlpha", "Alpha" (ColorPreview variants).
  • mode Allowed values: "RGB", "HSV", "HEX" (ColorEditMode variants).
  • format Allowed values: "Float", "U8" (ColorFormat variants).
  • catch
  • map Applies a mapping function to &mut Self.

Color Picker

color(picker(...))

Optional params

  • label
  • flags Function identifier that returns a ImGuiColorEditFlags.
  • preview Allowed values: "Opaque", "HalfAlpha", "Alpha" (ColorPreview variants).
  • mode Allowed values: "HueBar", "HueWheel" (ColorPickerMode variants).
  • format Allowed values: "Float", "U8" (ColorFormat variants).
  • catch
  • map Applies a mapping function to &mut Self.

Example

#[derive(imgui_ext::Gui)]
struct Example {
    // you could also nest all the modes inside of the same `color(...)`
    #[imgui(
        color(button(preview = "Alpha")),
        color(edit(preview = "HalfAlpha")),
        color(picker(mode = "HueWheel"))
    )]
    color: [f32; 4],
}

Result:

]result

Structs

ColorButtonParams
ColorEditParams
ColorPickerParams

Traits

ColorButton
ColorEdit
ColorPicker