MCPcopy Create free account
hub / github.com/brenocq/implot3d / GetAutoColor

Function GetAutoColor

implot3d.cpp:3396–3414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3394bool IsColorAuto(ImPlot3DCol idx) { return IsColorAuto(GImPlot3D->Style.Colors[idx]); }
3395
3396ImVec4 GetAutoColor(ImPlot3DCol idx) {
3397 switch (idx) {
3398 case ImPlot3DCol_TitleText: return ImGui::GetStyleColorVec4(ImGuiCol_Text);
3399 case ImPlot3DCol_InlayText: return ImGui::GetStyleColorVec4(ImGuiCol_Text);
3400 case ImPlot3DCol_FrameBg: return ImGui::GetStyleColorVec4(ImGuiCol_FrameBg);
3401 case ImPlot3DCol_PlotBg: return ImGui::GetStyleColorVec4(ImGuiCol_WindowBg);
3402 case ImPlot3DCol_PlotBorder: return ImGui::GetStyleColorVec4(ImGuiCol_Border);
3403 case ImPlot3DCol_LegendBg: return ImGui::GetStyleColorVec4(ImGuiCol_PopupBg);
3404 case ImPlot3DCol_LegendBorder: return ImGui::GetStyleColorVec4(ImGuiCol_Border);
3405 case ImPlot3DCol_LegendText: return ImGui::GetStyleColorVec4(ImGuiCol_Text);
3406 case ImPlot3DCol_AxisText: return ImGui::GetStyleColorVec4(ImGuiCol_Text);
3407 case ImPlot3DCol_AxisGrid: return ImGui::GetStyleColorVec4(ImGuiCol_Text) * ImVec4(1, 1, 1, 0.25f);
3408 case ImPlot3DCol_AxisTick: return GetStyleColorVec4(ImPlot3DCol_AxisGrid);
3409 case ImPlot3DCol_AxisBg: return ImVec4(0, 0, 0, 0);
3410 case ImPlot3DCol_AxisBgHovered: return ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
3411 case ImPlot3DCol_AxisBgActive: return ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive);
3412 default: return IMPLOT3D_AUTO_COL;
3413 }
3414}
3415
3416const char* GetStyleColorName(ImPlot3DCol idx) {
3417 static const char* color_names[ImPlot3DCol_COUNT] = {

Callers 1

GetStyleColorVec4Function · 0.85

Calls 1

GetStyleColorVec4Function · 0.85

Tested by

no test coverage detected