# Style settings

# Color

  • ImGui.PushStyleColor(int idx, int col)
    idx: ImGuiCol
local _clr = ImVec4.new(0.8, 0.3, 0.3, 1.0)
ImGui.PushStyleColor(ImGuiCol.Text, _clr)
-- Your code for where this color should be applied
ImGui.PopStyleColor()
ImGui.PushStyleColor(ImGuiCol.Text, 0.8, 0.3, 0.3, 1.0)
-- Your code for where this color should be applied
ImGui.PopStyleColor()
  • ImGui.PopStyleColor(int count)
ImGui.PopStyleColor()
ImGui.PushStyleColor(ImGuiCol.ImGuiCol.WindowBg, 0.8, 0.8, 0.8, 0.5)
ImGui.PushStyleColor(ImGuiCol.Text, 0.8, 0.3, 0.3, 1.0)
-- Your code for where this style should be applied
ImGui.PopStyleColor(2)
  • ImGui.GetStyleColorVec4(int idx)
local _r, _g, _b, _a = ImGui.GetStyleColorVec4(ImGuiCol.Text)
log.info("R: " .. _r .. ", G: " .. _g .. ", B: " .. _b .. ", A:" .. _a)

# Style

  • ImGui.PushStyleVar(int idx, float valX, float valY)
    idx: ImGuiStyleVar
local _vec2 = ImVec2.new(30, 30)
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, _vec2)
-- Your code for where this style should be applied
ImGui.PopStyleVar()
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, 30, 30)
-- Your code for where this style should be applied
ImGui.PopStyleVar()
  • ImGui.PopStyleVar(int count)
ImGui.PopStyleVar()
local _vec2 = ImVec2.new(30, 30)
ImGui.PushStyleVar(ImGuiCol.WindowPadding, _vec2)
ImGui.PushStyleVar(ImGuiCol.WindowRounding, 1)
-- Your code for where this style should be applied
ImGui.PopStyleVar(2)