Skip to main content

Color Edit

Color editor/picker widgets have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu.

ColorEdit3

Edit RGB color (without alpha).
const char*
Widget label
float[3]
Array of 3 floats (RGB, 0.0f to 1.0f)
ImGuiColorEditFlags
default:"0"
Color edit flags (see ImGuiColorEditFlags_)
bool
True when color has been modified

ColorEdit4

Edit RGBA color (with alpha).
const char*
Widget label
float[4]
Array of 4 floats (RGBA, 0.0f to 1.0f)
ImGuiColorEditFlags
default:"0"
Color edit flags
bool
True when color has been modified

Color Picker

ColorPicker3

Color picker widget for RGB.
const char*
Widget label
float[3]
Array of 3 floats (RGB)
ImGuiColorEditFlags
default:"0"
Color edit flags
bool
True when color has been modified

ColorPicker4

Color picker widget for RGBA.
const char*
Widget label
float[4]
Array of 4 floats (RGBA)
ImGuiColorEditFlags
default:"0"
Color edit flags
const float*
default:"NULL"
Optional reference color to display for comparison
bool
True when color has been modified

Color Button

ColorButton

Display a color square/button. Hover for details, return true when pressed.
const char*
Unique identifier
const ImVec4&
RGBA color
ImGuiColorEditFlags
default:"0"
Color edit flags
const ImVec2&
default:"ImVec2(0, 0)"
Button size (0 = default size)
bool
True when clicked

SetColorEditOptions

Initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
ImGuiColorEditFlags
Default color edit flags

Color Edit Flags

ImGuiColorEditFlags_

Flags for ColorEdit3(), ColorEdit4(), ColorPicker3(), ColorPicker4(), ColorButton().

Main Options

Alpha Display

User Options

Examples