pub enum SemanticTone {
Default,
Danger,
Success,
Warning,
Info,
}Expand description
Semantic palette shortcut shared across Material components.
Explicit per-instance color or border overrides always take precedence over semantic tone defaults, and disabled states keep their disabled appearance.
Variants§
Default
Component default theme palette (no semantic override).
Danger
Destructive or error semantic palette (Error / ErrorContainer).
Success
Positive or confirmation semantic palette (Success / SuccessContainer).
Warning
Cautionary semantic palette (Warning / WarningContainer).
Info
Informational semantic palette (Info / InfoContainer).
Implementations§
Source§impl SemanticTone
impl SemanticTone
Sourcepub const fn roles(self) -> Option<(ColorRole, ColorRole, ColorRole, ColorRole)>
pub const fn roles(self) -> Option<(ColorRole, ColorRole, ColorRole, ColorRole)>
Resolves (role, on_role, container, on_container) from
gpui_material_theme::ColorRole, returning None for
SemanticTone::Default.
Sourcepub const fn role(self) -> Option<ColorRole>
pub const fn role(self) -> Option<ColorRole>
Resolves the primary foreground/accent role for this tone.
Sourcepub const fn on_role(self) -> Option<ColorRole>
pub const fn on_role(self) -> Option<ColorRole>
Resolves the foreground role paired with Self::role.
Sourcepub const fn container_role(self) -> Option<ColorRole>
pub const fn container_role(self) -> Option<ColorRole>
Resolves the tonal container role for this tone.
Sourcepub const fn on_container_role(self) -> Option<ColorRole>
pub const fn on_container_role(self) -> Option<ColorRole>
Resolves the foreground role paired with Self::container_role.
Trait Implementations§
Source§impl Clone for SemanticTone
impl Clone for SemanticTone
Source§fn clone(&self) -> SemanticTone
fn clone(&self) -> SemanticTone
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SemanticTone
Source§impl Debug for SemanticTone
impl Debug for SemanticTone
Source§impl Default for SemanticTone
impl Default for SemanticTone
Source§fn default() -> SemanticTone
fn default() -> SemanticTone
impl Eq for SemanticTone
Source§impl PartialEq for SemanticTone
impl PartialEq for SemanticTone
impl StructuralPartialEq for SemanticTone
Auto Trait Implementations§
impl Forget for SemanticTone
impl Freeze for SemanticTone
impl Move for SemanticTone
impl RefUnwindSafe for SemanticTone
impl Send for SemanticTone
impl Sync for SemanticTone
impl Unpin for SemanticTone
impl UnsafeUnpin for SemanticTone
impl UnwindSafe for SemanticTone
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<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.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().