refactor(engine): route gameplay-feedback colours through Terminal tokens

Selection-highlight tints in selection_plugin and the valid-drop
marker tint in cursor_plugin were hand-tuned RGB literals from the
prior Premium-Solitaire palette. Migrate them to the semantic
state tokens introduced in ui_theme:

- keyboard-drag source highlight (picking)  → ACCENT_PRIMARY
- keyboard-drag source highlight (lifted)   → STATE_WARNING
- keyboard-drag destination highlight       → STATE_SUCCESS
- cursor_plugin::MARKER_VALID               → STATE_SUCCESS @ 0.55α

`MARKER_VALID` stays a Color literal (Alpha::with_alpha is not yet
const on stable); a new tracking test pins its RGB to STATE_SUCCESS
so a future palette swap can't drift the two apart silently.

Also fix three stale doc comments in ui_modal that still described
the previous yellow / magenta palette ("Loud yellow CTA",
"Primary swaps to the magenta secondary accent"). Cyan and lavender
now, matching the actual token values.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-07 18:06:57 -07:00
parent 0d477ac9fd
commit ceec4fc486
3 changed files with 49 additions and 14 deletions
+9 -4
View File
@@ -48,6 +48,7 @@ use crate::input_plugin::{best_destination, best_tableau_destination_for_stack};
use crate::layout::LayoutResource;
use crate::pause_plugin::PausedResource;
use crate::resources::{DragState, GameStateResource};
use crate::ui_theme::{ACCENT_PRIMARY, STATE_SUCCESS, STATE_WARNING};
// ---------------------------------------------------------------------------
// Public types
@@ -660,14 +661,18 @@ fn update_selection_highlight(
};
let card_size = layout.0.card_size;
// Choose colours per mode: cyan in source-pick, gold while lifted.
// Highlight tints follow the Terminal palette's semantic state
// tokens: cyan focus/selection while picking the source, gold
// attention/commitment once the cards are lifted, lime valid-move
// tint on the destination. Alphas are kept non-zero so the card
// face beneath remains readable through the wash.
let lifted = kbd_drag.is_lifted();
let source_color = if lifted {
Color::srgba(1.0, 0.84, 0.0, 0.6)
STATE_WARNING.with_alpha(0.6)
} else {
Color::srgba(0.0, 1.0, 1.0, 0.5)
ACCENT_PRIMARY.with_alpha(0.5)
};
let dest_color = Color::srgba(0.0, 1.0, 0.4, 0.6);
let dest_color = STATE_SUCCESS.with_alpha(0.6);
// Resolve the source pile from KeyboardDragState (when lifted) or
// SelectionState (otherwise). Lifted takes precedence so the gold