[][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

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

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

Example

use imgui_ext::ImGuiExt;

#[derive(ImGuiExt)]
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:

Structs

ColorButtonParams
ColorEditParams
ColorPickerParams

Traits

ColorButton
ColorEdit
ColorPicker