Keep automatic Design body colours clear of the selection colour

This commit is contained in:
SoftFever
2026-10-05 02:50:21 +08:00
parent 073e2d9c44
commit a29e3078e8
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -197,7 +197,9 @@ as the body (`DesignCanvas::rebuild_bodies`); the sketch overlay outlines them w
— a dark band under a selection-coloured one — so the outline still reads on a body that wears
the selection colour itself. A body picked whole, a face picked in the viewport and the faces of
the Feature tree's selected feature all draw this way. The hover pre-highlight is the outline
alone, uncased: it promises a click, it is not one.
alone, uncased: it promises a click, it is not one. The automatic body colours keep clear of the
selection colour's blues and teals, so no body looks selected before anything is picked; a colour
the user sets on a body is theirs, and the cased outline keeps its selection readable.
Selecting a feature row lights the faces that feature made, not the whole body it sits on, so a
fillet row shows its round and the extrude under it keeps the faces the fillet trimmed.
+4 -2
View File
@@ -227,12 +227,14 @@ DesignCanvas::~DesignCanvas()
}
// Distinct per-body colours (Onshape-style). Body 0 keeps the familiar gold; the rest
// cycle through a small saturated palette so coexisting solids read as separate parts.
// cycle through a small saturated palette so coexisting solids read as separate parts. No entry
// may sit near the selection cyan (design_selection_color): a blue or teal body would look
// selected, and its selected faces would barely stand out.
static ColorRGBA body_palette(int body_idx)
{
static const ColorRGBA kPalette[] = {
ColorRGBA(0.86f, 0.66f, 0.20f, 1.0f), // gold
ColorRGBA(0.30f, 0.62f, 0.90f, 1.0f), // blue
ColorRGBA(0.84f, 0.42f, 0.66f, 1.0f), // rose
ColorRGBA(0.45f, 0.78f, 0.42f, 1.0f), // green
ColorRGBA(0.86f, 0.45f, 0.40f, 1.0f), // coral
ColorRGBA(0.70f, 0.52f, 0.86f, 1.0f), // violet