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 <daniloleal09@gmail.com>
This commit is contained in:
Libon
2025-11-27 21:32:43 +00:00
committed by GitHub
co-authored by Danilo Leal
parent 77656a4091
commit b17b903c57
+7 -1
View File
@@ -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 {