pub struct Palette {
pub bg: Color,
pub surface: Color,
pub surface_alt: Color,
pub text_primary: Color,
pub text_secondary: Color,
pub accent: Color,
pub divider: Color,
pub icon: Color,
pub danger: Color,
pub danger_bg: Color,
}Expand description
Semantic colour tokens shared by every widget.
Fields§
§bg: ColorPage / wallpaper background when no image is present.
surface: ColorFloating surface over the wallpaper (cards, panels, dock) — usually translucent.
surface_alt: ColorElevated surface (hovered card, pressed toggle, inner pill).
text_primary: ColorPrimary foreground text.
text_secondary: ColorSubdued text (date strip, helper text, disabled labels).
accent: ColorBrand accent used for active toggles, sliders, focus rings.
divider: ColorThin separators and low-contrast borders.
icon: ColorTint for symbolic icons (wifi / battery / search / etc).
danger: ColorForeground colour for destructive / error states — text in “delete” buttons, error helper rows under invalid inputs, the border of an errored pill.
danger_bg: ColorSoft fill behind error states. Pairs with danger as
foreground; light enough that body text remains legible on
top.
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn from_slots(slots: &SlotStore) -> Self
pub fn from_slots(slots: &SlotStore) -> Self
Project a SlotStore onto the eight canonical palette fields.
Slot ids are the ones declared in the default theme JSON
(bg-page, surface, surface-alt, text-primary,
text-secondary, accent, divider, icon). Missing slots
fall back to a documented sensible default so downstream widgets
never see uninitialised colours. Used by crate::theme::palette() and
crate::theme::window_controls.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Palette
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin for Palette
impl UnwindSafe for Palette
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more