From b17b903c57462b0b63db7c51ba7e15b635598db9 Mon Sep 17 00:00:00 2001 From: Libon Date: Fri, 28 Nov 2025 05:32:43 +0800 Subject: [PATCH] Enhance color logic for phantom elements to improve visual distinction based on collision status (#42710) This change modifies the color assignment for phantom elements in the editor. If a phantom element collides with existing elements, it now uses a custom color based on the theme's debugger accent with reduced opacity. Otherwise, it defaults to the hint color. BEFORE: ![20251114-0939-17 9919633](https://github.com/user-attachments/assets/4ec56f03-4708-4b35-b1ab-abdfd41c763e) AFTER: ![20251114-0942-38 8596606](https://github.com/user-attachments/assets/6e9a98f1-a34d-4676-9dc6-b3e2b9f967bc) Release Notes: - Enhanced color logic for phantom elements to improve visual distinction based on collision status. --------- Co-authored-by: Danilo Leal --- crates/editor/src/editor.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 7cdd587db48de1f03bf54949c3bfbe7870a07073..2577591d3f5acfa2c351cd6aa89c9320e90db6c3 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -8420,8 +8420,14 @@ impl Editor { (true, true) => ui::IconName::DebugDisabledLogBreakpoint, }; + let color = cx.theme().colors(); + let color = if is_phantom { - Color::Hint + if collides_with_existing { + Color::Custom(color.debugger_accent.blend(color.text.opacity(0.6))) + } else { + Color::Hint + } } else if is_rejected { Color::Disabled } else {