pub struct PaneAffordanceTheme {
pub background: Color,
pub splitter_idle: Color,
pub splitter_hover: Color,
pub splitter_active: Color,
pub snap: Color,
pub focus_ring: Color,
pub high_contrast: bool,
}Expand description
Themeable colors for pane interaction affordances (bd-3bfbp).
Covers the splitter rail/handle in its three interaction states
(idle / hover / active), the magnetic-snap dock-preview emphasis, and the
keyboard focus ring around the active pane. Every color is derived from a
ResolvedTheme slot — there are no ad-hoc hardcoded values — and then
contrast-clamped so the affordance stays visible against the pane surface it
is drawn on:
- In the default profile each state meets at least WCAG AA: the large-text bar (3.0:1) for the ever-present low-emphasis idle divider, and the normal-text bar (4.5:1) for the meaning-bearing hover/active/snap/ring states.
- In the high-contrast profile (
high_contrast = true) every state is lifted to WCAG AAA (7.0:1).
Clamping preserves the themed hue when it already passes the target, and otherwise blends it toward whichever extreme (pure black or pure white) maximizes contrast with the surface, by the smallest amount that reaches the target ratio. This keeps affordances on-palette in well-designed themes while guaranteeing they never become invisible in low-contrast ones.
Fields§
§background: ColorSurface the affordances are drawn on (the pane background).
splitter_idle: ColorIdle splitter rail/handle (low-emphasis, always-present divider).
splitter_hover: ColorHovered splitter (pointer over the handle).
splitter_active: ColorActively dragged splitter.
snap: ColorMagnetic-snap / dock-preview emphasis.
focus_ring: ColorKeyboard focus ring around the active pane.
high_contrast: boolWhether this was built in the high-contrast profile.
Implementations§
Source§impl PaneAffordanceTheme
impl PaneAffordanceTheme
Sourcepub fn from_resolved(theme: &ResolvedTheme, high_contrast: bool) -> Self
pub fn from_resolved(theme: &ResolvedTheme, high_contrast: bool) -> Self
Derive affordance colors from a resolved theme.
high_contrast selects the WCAG target tier (AA vs AAA). Pass the
effective accessibility preference for the host here.
Sourcepub fn min_contrast_ratio(&self) -> f64
pub fn min_contrast_ratio(&self) -> f64
The minimum WCAG contrast ratio across all affordance states vs the surface. Useful as a single accessibility health metric in tests.
Trait Implementations§
Source§impl Clone for PaneAffordanceTheme
impl Clone for PaneAffordanceTheme
Source§fn clone(&self) -> PaneAffordanceTheme
fn clone(&self) -> PaneAffordanceTheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PaneAffordanceTheme
Source§impl Debug for PaneAffordanceTheme
impl Debug for PaneAffordanceTheme
impl Eq for PaneAffordanceTheme
Source§impl PartialEq for PaneAffordanceTheme
impl PartialEq for PaneAffordanceTheme
Source§fn eq(&self, other: &PaneAffordanceTheme) -> bool
fn eq(&self, other: &PaneAffordanceTheme) -> bool
self and other values to be equal, and is used by ==.