diff --git a/single-line-diagram-core/src/main/java/com/powsybl/sld/util/TopologicalStyleProvider.java b/single-line-diagram-core/src/main/java/com/powsybl/sld/util/TopologicalStyleProvider.java index f867945b7..216c4da5d 100644 --- a/single-line-diagram-core/src/main/java/com/powsybl/sld/util/TopologicalStyleProvider.java +++ b/single-line-diagram-core/src/main/java/com/powsybl/sld/util/TopologicalStyleProvider.java @@ -149,6 +149,18 @@ private RGBColor getSmartNodeColor(VoltageLevelInfos voltageLevelInfos, Node nod return null; } + @Override + protected String getEdgeColor(Node node1, Node node2) { + if (node1.getType() == NodeType.SWITCH && node1.isOpen()) { + return node2.getVoltageLevelInfos() != null ? getNodeColor(node2.getVoltageLevelInfos(), node2) : null; + } + if (node2.getType() == NodeType.SWITCH && node2.isOpen()) { + return node1.getVoltageLevelInfos() != null ? getNodeColor(node1.getVoltageLevelInfos(), node1) : null; + } + + return super.getEdgeColor(node1, node2); + } + @Override public String getNodeColor(VoltageLevelInfos voltageLevelInfos, Node node) { RGBColor rgbColor = getSmartNodeColor(voltageLevelInfos, node);