From e723c28f26fa5893dea2a4cd08f9fda342a2781d Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Fri, 14 Jun 2024 05:14:37 +0200 Subject: [PATCH] egui: add default colors for middle layers in 4-layer boards --- src/bin/topola-egui/layers.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/bin/topola-egui/layers.rs b/src/bin/topola-egui/layers.rs index 14f898e..336e0da 100644 --- a/src/bin/topola-egui/layers.rs +++ b/src/bin/topola-egui/layers.rs @@ -20,10 +20,16 @@ impl Layers { let colors = std::iter::repeat(egui::Color32::from_rgb(255, 255, 255)) .enumerate() .map(|(i, color)| { - if matches!(board.mesadata().layer_layername(i), Some("F.Cu")) { + let layername = board.mesadata().layer_layername(i); + + if matches!(layername, Some("F.Cu")) { egui::Color32::from_rgb(255, 52, 52) - } else if matches!(board.mesadata().layer_layername(i), Some("B.Cu")) { + } else if matches!(layername, Some("B.Cu")) { egui::Color32::from_rgb(52, 52, 255) + } else if matches!(layername, Some("In1.Cu")) { + egui::Color32::from_rgb(127, 200, 127) + } else if matches!(layername, Some("In2.Cu")) { + egui::Color32::from_rgb(206, 125, 44) } else { color } @@ -34,10 +40,16 @@ impl Layers { let highlight_colors = std::iter::repeat(egui::Color32::from_rgb(255, 255, 255)) .enumerate() .map(|(i, color)| { - if matches!(board.mesadata().layer_layername(i), Some("F.Cu")) { + let layername = board.mesadata().layer_layername(i); + + if matches!(layername, Some("F.Cu")) { egui::Color32::from_rgb(255, 100, 100) - } else if matches!(board.mesadata().layer_layername(i), Some("B.Cu")) { + } else if matches!(layername, Some("B.Cu")) { egui::Color32::from_rgb(100, 100, 255) + } else if matches!(layername, Some("In1.Cu")) { + egui::Color32::from_rgb(213, 236, 213) + } else if matches!(layername, Some("In2.Cu")) { + egui::Color32::from_rgb(232, 195, 158) } else { color }