MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / DrawRGBFields

Function DrawRGBFields

TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp:3575–3593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3573 }
3574
3575 void DrawRGBFields(float labelWidth, float valueWidth, const char* label, RGBA* color)
3576 {
3577 ImGui::SetNextItemWidth(labelWidth);
3578 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(color->getRedF(), color->getGreenF(), color->getBlueF(), color->getAlphaF()));
3579 ImGui::LabelText("##ConfigLabel", "%s", label);
3580 ImGui::PopStyleColor();
3581 ImGui::SameLine();
3582 RGBAf c = RGBAf();
3583 c.r = color->getRedF();
3584 c.g = color->getGreenF();
3585 c.b = color->getBlueF();
3586 c.a = color->getAlphaF();
3587
3588 ImGui::SetNextItemWidth(valueWidth);
3589 if (ImGui::SliderFloat4((string("##color") + label).c_str(), &c.r, 0.0f, 1.0f))
3590 {
3591 color->color = RGBA::fromFloats(c.r, c.g, c.b, c.a).color;
3592 }
3593 }
3594
3595 void DrawLabelledFloatSlider(float labelWidth, float valueWidth, const char* label, const char* tag, float* value, float min, float max)
3596 {

Callers 1

configA11yFunction · 0.85

Calls 7

RGBAfClass · 0.85
getRedFMethod · 0.80
getGreenFMethod · 0.80
getBlueFMethod · 0.80
getAlphaFMethod · 0.80
c_strMethod · 0.80
ImVec4Class · 0.50

Tested by

no test coverage detected