pub struct Visuals {Show 34 fields
pub bg_color: Color,
pub panel_fill: Color,
pub top_bar_bg: Color,
pub window_fill: Color,
pub window_title_fill: Color,
pub window_title_fill_drag: Color,
pub window_shadow: Color,
pub window_stroke: Color,
pub window_title_text: Color,
pub window_close_bg: Color,
pub window_close_bg_hovered: Color,
pub window_close_fg: Color,
pub window_resize_hover: Color,
pub window_resize_active: Color,
pub text_color: Color,
pub text_dim: Color,
pub text_link: Color,
pub text_link_hovered: Color,
pub accent: Color,
pub accent_hovered: Color,
pub accent_pressed: Color,
pub accent_focus: Color,
pub widget_bg: Color,
pub widget_bg_hovered: Color,
pub widget_stroke: Color,
pub widget_stroke_active: Color,
pub track_bg: Color,
pub scroll_track: Color,
pub scroll_thumb: Color,
pub scroll_thumb_hovered: Color,
pub scroll_thumb_dragging: Color,
pub separator: Color,
pub selection_bg: Color,
pub selection_bg_unfocused: Color,
}Expand description
All colours used by the widget library.
The canonical way to access the active palette inside Widget::paint is:
let v = ctx.visuals();
ctx.set_fill_color(v.window_fill);Fields§
§bg_color: ColorCanvas / app background (behind all floating windows).
panel_fill: ColorSidebar / panel background.
top_bar_bg: ColorTop menu bar background.
window_fill: ColorWindow content-area background.
window_title_fill: ColorWindow title bar background (idle).
window_title_fill_drag: ColorWindow title bar background while dragging.
window_shadow: ColorDrop-shadow colour (semi-transparent black/dark).
window_stroke: ColorThin border drawn around the window.
window_title_text: ColorTitle bar text colour.
window_close_bg: ColorClose button background (idle).
window_close_bg_hovered: ColorClose button background (hovered).
window_close_fg: ColorClose button × glyph colour.
window_resize_hover: ColorResize edge / corner highlight colour when hovered (not yet dragging).
window_resize_active: ColorResize edge / corner highlight colour while actively dragging to resize.
text_color: ColorBody text colour.
text_dim: ColorSecondary / dimmed text (hints, labels).
text_link: ColorHyperlink colour (idle).
text_link_hovered: ColorHyperlink colour (hovered).
accent: ColorUsed for checked states, active tabs, slider fill, button backgrounds.
accent_hovered: ColorAccent colour when hovered.
accent_pressed: ColorAccent colour when pressed / active.
accent_focus: ColorLow-opacity accent used for focus rings.
widget_bg: ColorWidget background when unchecked / idle.
widget_bg_hovered: ColorWidget background when hovered (unchecked).
widget_stroke: ColorWidget border / outline (unchecked).
widget_stroke_active: ColorWidget border / outline (checked / active).
track_bg: Color§scroll_track: Color§scroll_thumb: Color§scroll_thumb_hovered: Color§scroll_thumb_dragging: Color§separator: Color§selection_bg: ColorBackground colour behind selected text while the widget is focused.
selection_bg_unfocused: ColorBackground colour behind selected text while the widget is NOT focused. Uses a neutral grey to signal that the selection is inactive.
Implementations§
Source§impl Visuals
impl Visuals
Sourcepub fn for_preference(pref: ThemePreference) -> Self
pub fn for_preference(pref: ThemePreference) -> Self
Choose a palette from a ThemePreference. System falls back to dark.