pub struct Palette {
pub page: Color32,
pub raised: Color32,
pub overlay: Color32,
pub well: Option<Color32>,
pub bevel_light: Color32,
pub bevel_dark: Color32,
}Expand description
The resolved colours this renderer needs, as flat values.
Built by the app from whatever it already uses to resolve a theme, then held and reused. Deliberately not a trait and not string-keyed: a bevel is painted per widget per frame, and a map lookup per edge is a cost with nothing to show for it.
Fields§
§page: Color32surface-page.
raised: Color32surface-raised.
overlay: Color32surface-overlay.
well: Option<Color32>surface-well, absent on makeover before 2.3.0.
bevel_light: Color32bevel-light.
bevel_dark: Color32bevel-dark.
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn fill(&self, fill: Fill) -> Color32
pub fn fill(&self, fill: Fill) -> Color32
Resolve a surface intent.
Fill::Well substitutes the page when the theme has no surface-well,
which is every theme on makeover before 2.3.0. That substitution lives
here rather than in the description because it is only right for a
renderer that can always paint an exact colour: makeover-tui had to
reject it, since on a terminal the page is often the very surface the
well is cut into and the two quantise together.
Delete it once 2.3.0 is published and the consumers adopt it.
Trait Implementations§
impl Copy for Palette
impl Eq for Palette
impl StructuralPartialEq for Palette
Auto Trait Implementations§
impl Freeze 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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