pub struct SchemeTonalSpot { /* private fields */ }Expand description
A tonal spot color scheme emphasizing the source color with tonal adjustments.
Uses the source color as an accent with complementary tones. This is the most commonly used variant and the default for Material Design 3.
§Example
use mcu_scheme::SchemeTonalSpot;
use mcu_hct::Hct;
let source = Hct::from_int(0xFF0000FF); // Blue
let scheme = SchemeTonalSpot::new(source, false, 0.0);
assert!(!scheme.is_dark);Implementations§
Source§impl SchemeTonalSpot
impl SchemeTonalSpot
Sourcepub fn new(source_color_hct: Hct, is_dark: bool, contrast_level: f64) -> Self
pub fn new(source_color_hct: Hct, is_dark: bool, contrast_level: f64) -> Self
Create a new tonal spot scheme.
§Arguments
source_color_hct- The source color in HCT color spaceis_dark- Whether to generate a dark mode schemecontrast_level- Contrast level from -1.0 (minimum) to 1.0 (maximum), 0.0 is standard
Sourcepub fn with_options(
source_color_hct: Hct,
is_dark: bool,
contrast_level: f64,
platform: Platform,
spec_version: SpecVersion,
) -> Self
pub fn with_options( source_color_hct: Hct, is_dark: bool, contrast_level: f64, platform: Platform, spec_version: SpecVersion, ) -> Self
Create a new tonal spot scheme with full options.
§Arguments
source_color_hct- The source color in HCT color spaceis_dark- Whether to generate a dark mode schemecontrast_level- Contrast level from -1.0 (minimum) to 1.0 (maximum), 0.0 is standardplatform- Target platform (Phone or Watch)spec_version- Design spec version (2021 or 2025)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SchemeTonalSpot
impl RefUnwindSafe for SchemeTonalSpot
impl Send for SchemeTonalSpot
impl Sync for SchemeTonalSpot
impl Unpin for SchemeTonalSpot
impl UnsafeUnpin for SchemeTonalSpot
impl UnwindSafe for SchemeTonalSpot
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