Expand description
Deck-level effects + theming — wires the theme palettes
and the effects bloom/raven into the
FacetDeck as opt-in, host-controllable features.
Three things a host gets, all off by default and cheap when off:
- Palette switching at runtime —
DeckFx::cycle_palette/set_paletteadvance an index intoTheme::ALL, andFacetDeck::palette_pickerdraws a one-line switcher the host can show anywhere. The deck applies the chosen palette withset_themeeach frame. - Glow on the active facet — toggle
DeckFx::glow; when on, the deck blooms the active facet’s content rect with [effects::glow_rect] using the palette’sglowcolour, pulsing witheasing::ease_in_out_cubic. - Summon the raven onto a target rect — [
FacetDeck::send_raven] launches aRavenSpritethat flies in and perches on any rect a facet/host hands it (e.g. a table row). The deck drives + paints it on a foreground layer.
The whole surface is additive: an existing deck keeps working unchanged until a
host opts in via [FacetDeck::with_fx] / fx_mut.
Structs§
- DeckFx
- Opt-in deck effects config.
Defaultis everything off (no palette override, no glow), so a deck that never touches it pays nothing. - Deck
Raven - A raven launched through the deck, flying toward a perch rect. The deck owns
one of these at a time (a fresh
send_ravenreplaces it) and drives it on a foreground layer.
Functions§
- launch_
point - Where a deck raven launches from for a given perch: up-and-left, so it swoops down onto the row. Pure (testable without a context).
- next_
palette - Index of the next palette after
currentinTheme::ALL, wrapping.None(no current selection) maps to0. Pure — the unit-tested cycle core. - palette_
index - Resolve a palette name to its index in
Theme::ALL(same fuzzy matching asTheme::by_name).Noneif unknown. Pure.