| 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 | { |