Style Color Stack
PushStyleColor
NewFrame().
ImGuiCol
Color identifier (e.g.,
ImGuiCol_WindowBg, ImGuiCol_Button)ImU32 or ImVec4
Color value
PopStyleColor
int
default:"1"
Number of colors to pop
Color Retrieval
GetColorU32
ImDrawList.
ImGuiCol
Style color identifier
ImVec4 or ImU32
Color value
float
default:"1.0f"
Optional extra alpha multiplier
ImU32
32-bit color value with alpha applied
GetStyleColorVec4
ImGuiStyle structure. Use to feed back into PushStyleColor().
ImGuiCol
Color identifier
const ImVec4&
Color as ImVec4
Use
GetColorU32() instead if you need the color for drawing, as it applies style alpha.ImGuiCol Enum
Color identifiers for styling:Color Utilities
ColorConvertU32ToFloat4
ImU32
32-bit packed color (RGBA)
ImVec4
Color as ImVec4 with components in range [0.0f, 1.0f]
ColorConvertFloat4ToU32
const ImVec4&
Color as ImVec4
ImU32
32-bit packed color (RGBA)
ColorConvertRGBtoHSV
float
RGB components in range [0.0f, 1.0f]
float&
Output HSV components. H in range [0.0f, 1.0f], S and V in range [0.0f, 1.0f]
ColorConvertHSVtoRGB
float
HSV components. H in range [0.0f, 1.0f], S and V in range [0.0f, 1.0f]
float&
Output RGB components in range [0.0f, 1.0f]
Color Macros
IM_COL32
IM_COL32_WHITE / IM_COL32_BLACK
ImColor Helper
Common Color Patterns
Themed Button
Danger Button
Transparent Window
Highlighted Section
Modifying Default Colors
See Also
- Style - Style configuration
- ImGuiStyle - Complete style structure
- Draw List - Using colors with drawing commands