pub struct CorePalette {
pub primary: TonalPalette,
pub secondary: TonalPalette,
pub tertiary: TonalPalette,
pub neutral: TonalPalette,
pub neutral_variant: TonalPalette,
pub error: TonalPalette,
}Expand description
The six tonal ramps a Material scheme is drawn from.
Fields§
§primary: TonalPaletteThe seed’s own hue at chroma max(48, seed chroma).
secondary: TonalPaletteThe seed’s hue, muted (chroma 16).
tertiary: TonalPaletteThe seed’s hue rotated +60°, chroma 24.
neutral: TonalPaletteThe seed’s hue, near-gray (chroma 6) — surfaces and their content.
neutral_variant: TonalPaletteThe seed’s hue, slightly more colored than Self::neutral (chroma
8) — outlines and surface-variant content.
error: TonalPaletteA fixed red ramp (hue 25, chroma 84), independent of the seed.
Implementations§
Source§impl CorePalette
impl CorePalette
Sourcepub fn of(seed: Color) -> Self
pub fn of(seed: Color) -> Self
Derive all six ramps from one seed color (its alpha is ignored).
primary keeps the seed’s own chroma whenever that clears Material’s
floor of 48, so a sufficiently colorful seed reappears verbatim as the
light scheme’s primary (tone 40). A gray or black
seed has no meaningful hue of its own: CAM16 reports ~209.5° for
grays and whites and exactly 0° for pure black, and this module keeps
that behavior rather than substituting a hue of its own — the chroma
floor alone is what turns a colorless seed into a usable theme.
Trait Implementations§
Source§impl Clone for CorePalette
impl Clone for CorePalette
impl Copy for CorePalette
Source§impl Debug for CorePalette
impl Debug for CorePalette
Source§impl PartialEq for CorePalette
impl PartialEq for CorePalette
impl StructuralPartialEq for CorePalette
Auto Trait Implementations§
impl Freeze for CorePalette
impl RefUnwindSafe for CorePalette
impl Send for CorePalette
impl Sync for CorePalette
impl Unpin for CorePalette
impl UnsafeUnpin for CorePalette
impl UnwindSafe for CorePalette
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.