MCPcopy Create free account
hub / github.com/chrxh/alien / colorCheckbox

Method colorCheckbox

source/Gui/MassOperationsDialog.cpp:132–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void MassOperationsDialog::colorCheckbox(std::string id, uint32_t cellColor, bool& check)
133{
134 float h, s, v;
135 AlienImGui::ConvertRGBtoHSV(cellColor, h, s, v);
136 ImGui::PushStyleColor(ImGuiCol_FrameBg, (ImVec4)ImColor::HSV(h, s * 0.6f, v * 0.3f));
137 ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, (ImVec4)ImColor::HSV(h, s * 0.7f, v * 0.5f));
138 ImGui::PushStyleColor(ImGuiCol_FrameBgActive, (ImVec4)ImColor::HSV(h, s * 0.8f, v * 0.8f));
139 ImGui::PushStyleColor(ImGuiCol_CheckMark, (ImVec4)ImColor::HSV(h, s, v));
140 ImGui::Checkbox(id.c_str(), &check);
141 ImGui::PopStyleColor(4);
142}
143
144void MassOperationsDialog::onExecute()
145{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected