pub struct PaletteBuilder { /* private fields */ }Expand description
Implementations§
Source§impl PaletteBuilder
impl PaletteBuilder
Sourcepub fn background(self, c: Color) -> Self
pub fn background(self, c: Color) -> Self
Set the background colour.
Sourcepub fn text_primary(self, c: Color) -> Self
pub fn text_primary(self, c: Color) -> Self
Set the primary text colour.
Sourcepub fn text_secondary(self, c: Color) -> Self
pub fn text_secondary(self, c: Color) -> Self
Set the secondary / muted text colour.
Sourcepub fn on_primary(self, c: Color) -> Self
pub fn on_primary(self, c: Color) -> Self
Set the “on-primary” text colour (drawn on top of primary).
Sourcepub fn validate(&self) -> ValidationResult
pub fn validate(&self) -> ValidationResult
Validate all foreground/background pairs and return a ValidationResult.
Sourcepub fn build(self) -> Result<CooljapanTheme, Vec<ContrastWarning>>
pub fn build(self) -> Result<CooljapanTheme, Vec<ContrastWarning>>
Assemble a CooljapanTheme from the builder’s colours.
Returns Err if any foreground/background pair fails WCAG AA (< 4.5:1).
Trait Implementations§
Source§impl Clone for PaletteBuilder
impl Clone for PaletteBuilder
Source§fn clone(&self) -> PaletteBuilder
fn clone(&self) -> PaletteBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaletteBuilder
impl Debug for PaletteBuilder
Source§impl Default for PaletteBuilder
impl Default for PaletteBuilder
Source§fn default() -> PaletteBuilder
fn default() -> PaletteBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PaletteBuilder
impl RefUnwindSafe for PaletteBuilder
impl Send for PaletteBuilder
impl Sync for PaletteBuilder
impl Unpin for PaletteBuilder
impl UnsafeUnpin for PaletteBuilder
impl UnwindSafe for PaletteBuilder
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