pub struct Palette {
pub page: Color,
pub raised: Color,
pub overlay: Color,
pub well: Option<Color>,
pub bevel_light: Color,
pub bevel_dark: Color,
}Expand description
The resolved colours this renderer needs.
Supply them already quantised to whatever the terminal can show. That is
what makes Palette::shows a plain inequality rather than a colour-space
calculation: by the time a colour reaches here, the question of what the
terminal will actually paint has been answered.
Fields§
§page: Colorsurface-page.
raised: Colorsurface-raised.
overlay: Colorsurface-overlay.
well: Option<Color>surface-well, absent on makeover before 2.3.0.
bevel_light: Colorbevel-light.
bevel_dark: Colorbevel-dark.
Implementations§
Source§impl Palette
impl Palette
Sourcepub const fn fill(&self, fill: Fill) -> Option<Color>
pub const fn fill(&self, fill: Fill) -> Option<Color>
Resolve a surface intent, or None where the theme has no such colour.
No substitution happens here. A missing intent stays missing, and
frame answers it with structure instead of with a different colour.
Sourcepub fn shows(fill: Color, behind: Color) -> bool
pub fn shows(fill: Color, behind: Color) -> bool
Whether painting fill over behind would show anything.
The whole of the terminal’s problem in one predicate. On a truecolor terminal this is almost always true; in sixteen colours it is false often enough that a design relying on fills is a design that vanishes.
Sourcepub fn two_tone(&self) -> bool
pub fn two_tone(&self) -> bool
Whether this palette can express a bevel as two distinct edges.
When the two edge colours quantise together the frame reads as a plain box rather than a lit one. That is a degradation, not a failure: one box is still a boundary. makeover’s own test suite already names the shipped themes where it happens.
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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