Skip to main content

toggle_face_colors

Function toggle_face_colors 

pub fn toggle_face_colors(
    theme: &Theme,
    on: bool,
    interact: ToggleInteract,
) -> ToggleColors
Expand description

Single source of truth for both the retained Toggle’s draw and Toggle::paint, so every switch shares one palette per state.

On, the switch is an inverted control: the track is intent.inverted and the knob its label colour (intent.on_inverted). Off, the track is a lift of the ground (HIG §9.2, §9.5 “Rest edges”). On a light material the off knob is a raised white object with a derived ring, never a dark disc; on a dark one it is the secondary ink, and hover lifts it to the primary ink. Focus is your colour round the track.