@@ -41,8 +41,37 @@ struct NodeColor {
4141
4242using LogLevel = LogParsingHelpers::LogLevel;
4343
44- NodeColor decideColorForNode (const DeviceInfo& info)
44+ NodeColor decideColorForNode (const DeviceInfo& info, bool lightMode )
4545{
46+ if (lightMode) {
47+ // Dark-on-bright: rich medium-dark cards on a white canvas, white text on nodes
48+ if (info.active == false ) {
49+ return NodeColor{
50+ .normal = ImVec4 (0xb5 / 255 .f , 0x26 / 255 .f , 0x18 / 255 .f , 1 ), // dark crimson
51+ .hovered = ImVec4 (0xc2 / 255 .f , 0x2d / 255 .f , 0x1d / 255 .f , 1 )};
52+ }
53+ switch (info.streamingState ) {
54+ case StreamingState::EndOfStreaming:
55+ return NodeColor{
56+ .normal = ImVec4 (0x8c / 255 .f , 0x6c / 255 .f , 0x00 / 255 .f , 1 ), // dark amber
57+ .hovered = ImVec4 (0x9e / 255 .f , 0x7a / 255 .f , 0x00 / 255 .f , 1 ),
58+ .title = ImVec4 (0x6e / 255 .f , 0x54 / 255 .f , 0x00 / 255 .f , 1 ),
59+ .title_hovered = ImVec4 (0x5a / 255 .f , 0x44 / 255 .f , 0x00 / 255 .f , 1 )};
60+ case StreamingState::Idle:
61+ return NodeColor{
62+ .normal = ImVec4 (0x1a / 255 .f , 0x80 / 255 .f , 0x40 / 255 .f , 1 ), // dark forest green
63+ .hovered = ImVec4 (0x22 / 255 .f , 0x8b / 255 .f , 0x47 / 255 .f , 1 ),
64+ .title = ImVec4 (0x11 / 255 .f , 0x60 / 255 .f , 0x2e / 255 .f , 1 ),
65+ .title_hovered = ImVec4 (0x0a / 255 .f , 0x4d / 255 .f , 0x23 / 255 .f , 1 )};
66+ case StreamingState::Streaming:
67+ default :
68+ return NodeColor{
69+ .normal = ImVec4 (0x3a / 255 .f , 0x3a / 255 .f , 0x3c / 255 .f , 1 ), // macOS tertiary dark
70+ .hovered = ImVec4 (0x48 / 255 .f , 0x48 / 255 .f , 0x4a / 255 .f , 1 ),
71+ .title = ImVec4 (0x2c / 255 .f , 0x2c / 255 .f , 0x2e / 255 .f , 1 ),
72+ .title_hovered = ImVec4 (0x1c / 255 .f , 0x1c / 255 .f , 0x1e / 255 .f , 1 )};
73+ }
74+ }
4675 if (info.active == false ) {
4776 return NodeColor{
4877 .normal = PaletteHelpers::RED,
@@ -82,7 +111,7 @@ const static ImColor ARROW_BACKGROUND_COLOR = {100, 100, 0};
82111const static ImColor ARROW_HALFGROUND_COLOR = {170 , 170 , 70 };
83112const static ImColor ARROW_COLOR = {200 , 200 , 100 };
84113const static ImColor ARROW_SELECTED_COLOR = {200 , 0 , 100 };
85- const static ImU32 GRID_COLOR = ImColor(200 , 200 , 200 , 40 );
114+ const static ImU32 GRID_COLOR = ImColor(150 , 150 , 150 , 80 );
86115const static ImColor NODE_BORDER_COLOR = {100 , 100 , 100 };
87116const static ImColor LEGEND_COLOR = {100 , 100 , 100 };
88117
@@ -508,6 +537,8 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
508537 ImGui::SameLine ();
509538 ImGui::Checkbox (" Show legend" , &show_legend);
510539 ImGui::SameLine ();
540+ ImGui::Checkbox (" Light mode" , &state.topologyLightMode );
541+ ImGui::SameLine ();
511542 if (ImGui::Button (" Center" )) {
512543 scrolling = ImVec2 (0 ., 0 .);
513544 }
@@ -577,11 +608,10 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
577608
578609 ImGui::PushStyleVar (ImGuiStyleVar_FramePadding, ImVec2 (1 , 1 ));
579610 ImGui::PushStyleVar (ImGuiStyleVar_WindowPadding, ImVec2 (0 , 0 ));
580- #if defined(ImGuiCol_ChildWindowBg)
581- ImGui::PushStyleColor (ImGuiCol_ChildWindowBg, (ImU32)ImColor (60 , 60 , 70 , 200 ));
582- #else
583- ImGui::PushStyleColor (ImGuiCol_WindowBg, (ImU32)ImColor (60 , 60 , 70 , 200 ));
584- #endif
611+ auto canvasBg = state.topologyLightMode ? (ImU32)ImColor (250 , 250 , 252 , 255 ) : (ImU32)ImColor (44 , 44 , 46 , 255 );
612+ auto canvasText = (ImU32)ImColor (235 , 235 , 245 , 255 ); // nodes are always dark, so text is always light
613+ ImGui::PushStyleColor (ImGuiCol_ChildBg, canvasBg);
614+ ImGui::PushStyleColor (ImGuiCol_Text, canvasText);
585615 ImVec2 graphSize = ImGui::GetWindowSize ();
586616 if (state.leftPaneVisible ) {
587617 graphSize.x -= state.leftPaneSize ;
@@ -604,6 +634,12 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
604634
605635 ImVec2 win_pos = ImGui::GetCursorScreenPos ();
606636 ImVec2 canvas_sz = ImGui::GetWindowSize ();
637+
638+ // Arrow colors — richer amber in light mode to stand out on white canvas
639+ const ImColor arrowBgColor = state.topologyLightMode ? ImColor (140 , 80 , 0 ) : ARROW_BACKGROUND_COLOR;
640+ const ImColor arrowHalfColor = state.topologyLightMode ? ImColor (180 , 110 , 0 ) : ARROW_HALFGROUND_COLOR;
641+ const ImColor arrowColor = state.topologyLightMode ? ImColor (220 , 140 , 0 ) : ARROW_COLOR;
642+
607643 // Display links but only if they are inside the view.
608644 for (int link_idx = 0 ; link_idx < links.Size ; link_idx++) {
609645 // Do the geometry culling upfront.
@@ -627,7 +663,7 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
627663 continue ;
628664 }
629665 draw_list->ChannelsSetCurrent (0 ); // Background
630- auto color = ARROW_BACKGROUND_COLOR ;
666+ auto color = arrowBgColor ;
631667 auto thickness = ARROW_BACKGROUND_THICKNESS;
632668
633669 bool p1Inside = false ;
@@ -643,12 +679,12 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
643679 if (p1Inside && p2Inside) {
644680 // Whatever the two edges completely within the view, gets brighter color and foreground.
645681 draw_list->ChannelsSetCurrent (2 );
646- color = ARROW_COLOR ;
682+ color = arrowColor ;
647683 thickness = ARROW_THICKNESS;
648684 } else if (p1Inside || p2Inside) {
649685 draw_list->ChannelsSetCurrent (1 );
650686 // Whenever one of the two ends is within the view, increase the color but keep the background
651- color = ARROW_HALFGROUND_COLOR ;
687+ color = arrowHalfColor ;
652688 thickness = ARROW_HALFGROUND_THICKNESS;
653689 }
654690
@@ -756,7 +792,7 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
756792 scrolling = scrolling - ImVec2 (ImGui::GetIO ().MouseDelta .x / 4 .f , ImGui::GetIO ().MouseDelta .y / 4 .f );
757793 }
758794
759- auto nodeBg = decideColorForNode (info);
795+ auto nodeBg = decideColorForNode (info, state. topologyLightMode );
760796
761797 auto hovered = (node_hovered_in_list == node->ID || node_hovered_in_scene == node->ID || (node_hovered_in_list == -1 && node_selected == node->ID ));
762798 ImVec4 nodeBgColor = hovered ? nodeBg.hovered : nodeBg.normal ;
@@ -776,7 +812,7 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
776812 auto pp1 = p1 + offset + slotPos;
777813 auto pp2 = p2 + offset + slotPos;
778814 auto pp3 = p3 + offset + slotPos;
779- auto color = ARROW_COLOR ;
815+ auto color = arrowColor ;
780816 if (node_idx == node_selected) {
781817 color = ARROW_SELECTED_COLOR;
782818 }
@@ -881,7 +917,7 @@ void showTopologyNodeGraph(WorkspaceGUIState& state,
881917
882918 ImGui::PopItemWidth ();
883919 ImGui::EndChild ();
884- ImGui::PopStyleColor ();
920+ ImGui::PopStyleColor (2 );
885921 ImGui::PopStyleVar (2 );
886922 ImGui::EndGroup ();
887923
0 commit comments