pub struct Palette {
pub dark: bool,
pub colors: [Color; 16],
}Expand description
The color of every SystemColor role in one appearance: what an Ink resolves
against. Day keeps the toolkit’s answer for the app’s current appearance as
Palette::current and refreshes it when the appearance changes.
Fields§
§dark: boolWhether this is the dark appearance.
colors: [Color; 16]One color per role, in SystemColor::ALL order.
Implementations§
Source§impl Palette
impl Palette
Sourcepub const fn fallback(dark: bool) -> Palette
pub const fn fallback(dark: bool) -> Palette
Day’s own palette for one appearance (SystemColor::fallback for every role).
Sourcepub const fn color(&self, role: SystemColor) -> Color
pub const fn color(&self, role: SystemColor) -> Color
The color of role.
Sourcepub fn current() -> Palette
pub fn current() -> Palette
The palette of the app’s current appearance. Day sets it when the tree is installed and
whenever the toolkit reports an appearance change; before that it is Day’s light
fallback (or the dark one under DAY_THEME=dark).
Sourcepub fn set_current(palette: Palette)
pub fn set_current(palette: Palette)
Make palette the current one. Called by Day’s core when it reads the toolkit’s
palette; a toolkit does not call it.
Trait Implementations§
impl Copy for Palette
impl StructuralPartialEq for Palette
Auto Trait Implementations§
impl Forget for Palette
impl Freeze for Palette
impl Move for Palette
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin for Palette
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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