Skip to main content

ColorRole

Enum ColorRole 

Source
pub enum ColorRole {
Show 61 variants Background, Error, ErrorContainer, Info, InfoContainer, InverseOnSurface, InversePrimary, InverseSurface, OnBackground, OnError, OnErrorContainer, OnInfo, OnInfoContainer, OnPrimary, OnPrimaryContainer, OnPrimaryFixed, OnPrimaryFixedVariant, OnSecondary, OnSecondaryContainer, OnSecondaryFixed, OnSecondaryFixedVariant, OnSuccess, OnSuccessContainer, OnSurface, OnSurfaceVariant, OnTertiary, OnTertiaryContainer, OnTertiaryFixed, OnTertiaryFixedVariant, OnWarning, OnWarningContainer, Outline, OutlineVariant, Primary, PrimaryContainer, PrimaryFixed, PrimaryFixedDim, Scrim, Secondary, SecondaryContainer, SecondaryFixed, SecondaryFixedDim, Shadow, Success, SuccessContainer, Surface, SurfaceBright, SurfaceContainer, SurfaceContainerHigh, SurfaceContainerHighest, SurfaceContainerLow, SurfaceContainerLowest, SurfaceDim, SurfaceTint, SurfaceVariant, Tertiary, TertiaryContainer, TertiaryFixed, TertiaryFixedDim, Warning, WarningContainer,
}
Expand description

Semantic Material color roles.

Variants§

§

Background

The md.sys.color.background Material color role.

§

Error

The md.sys.color.error Material color role.

§

ErrorContainer

The md.sys.color.error-container Material color role.

§

Info

The md.sys.color.info Material color role.

§

InfoContainer

The md.sys.color.info-container Material color role.

§

InverseOnSurface

The md.sys.color.inverse-on-surface Material color role.

§

InversePrimary

The md.sys.color.inverse-primary Material color role.

§

InverseSurface

The md.sys.color.inverse-surface Material color role.

§

OnBackground

The md.sys.color.on-background Material color role.

§

OnError

The md.sys.color.on-error Material color role.

§

OnErrorContainer

The md.sys.color.on-error-container Material color role.

§

OnInfo

The md.sys.color.on-info Material color role.

§

OnInfoContainer

The md.sys.color.on-info-container Material color role.

§

OnPrimary

The md.sys.color.on-primary Material color role.

§

OnPrimaryContainer

The md.sys.color.on-primary-container Material color role.

§

OnPrimaryFixed

The md.sys.color.on-primary-fixed Material color role.

§

OnPrimaryFixedVariant

The md.sys.color.on-primary-fixed-variant Material color role.

§

OnSecondary

The md.sys.color.on-secondary Material color role.

§

OnSecondaryContainer

The md.sys.color.on-secondary-container Material color role.

§

OnSecondaryFixed

The md.sys.color.on-secondary-fixed Material color role.

§

OnSecondaryFixedVariant

The md.sys.color.on-secondary-fixed-variant Material color role.

§

OnSuccess

The md.sys.color.on-success Material color role.

§

OnSuccessContainer

The md.sys.color.on-success-container Material color role.

§

OnSurface

The md.sys.color.on-surface Material color role.

§

OnSurfaceVariant

The md.sys.color.on-surface-variant Material color role.

§

OnTertiary

The md.sys.color.on-tertiary Material color role.

§

OnTertiaryContainer

The md.sys.color.on-tertiary-container Material color role.

§

OnTertiaryFixed

The md.sys.color.on-tertiary-fixed Material color role.

§

OnTertiaryFixedVariant

The md.sys.color.on-tertiary-fixed-variant Material color role.

§

OnWarning

The md.sys.color.on-warning Material color role.

§

OnWarningContainer

The md.sys.color.on-warning-container Material color role.

§

Outline

The md.sys.color.outline Material color role.

§

OutlineVariant

The md.sys.color.outline-variant Material color role.

§

Primary

The md.sys.color.primary Material color role.

§

PrimaryContainer

The md.sys.color.primary-container Material color role.

§

PrimaryFixed

The md.sys.color.primary-fixed Material color role.

§

PrimaryFixedDim

The md.sys.color.primary-fixed-dim Material color role.

§

Scrim

The md.sys.color.scrim Material color role.

§

Secondary

The md.sys.color.secondary Material color role.

§

SecondaryContainer

The md.sys.color.secondary-container Material color role.

§

SecondaryFixed

The md.sys.color.secondary-fixed Material color role.

§

SecondaryFixedDim

The md.sys.color.secondary-fixed-dim Material color role.

§

Shadow

The md.sys.color.shadow Material color role.

§

Success

The md.sys.color.success Material color role.

§

SuccessContainer

The md.sys.color.success-container Material color role.

§

Surface

The md.sys.color.surface Material color role.

§

SurfaceBright

The md.sys.color.surface-bright Material color role.

§

SurfaceContainer

The md.sys.color.surface-container Material color role.

§

SurfaceContainerHigh

The md.sys.color.surface-container-high Material color role.

§

SurfaceContainerHighest

The md.sys.color.surface-container-highest Material color role.

§

SurfaceContainerLow

The md.sys.color.surface-container-low Material color role.

§

SurfaceContainerLowest

The md.sys.color.surface-container-lowest Material color role.

§

SurfaceDim

The md.sys.color.surface-dim Material color role.

§

SurfaceTint

The md.sys.color.surface-tint Material color role.

§

SurfaceVariant

The md.sys.color.surface-variant Material color role.

§

Tertiary

The md.sys.color.tertiary Material color role.

§

TertiaryContainer

The md.sys.color.tertiary-container Material color role.

§

TertiaryFixed

The md.sys.color.tertiary-fixed Material color role.

§

TertiaryFixedDim

The md.sys.color.tertiary-fixed-dim Material color role.

§

Warning

The md.sys.color.warning Material color role.

§

WarningContainer

The md.sys.color.warning-container Material color role.

Implementations§

Source§

impl ColorRole

Source

pub const fn on_role(self) -> Option<Self>

Returns the standard Material foreground role paired with this semantic background role, or None when this role is not a paired background.

Source§

impl ColorRole

Source

pub const ALL: [Self; 61]

All supported roles, in a stable order for this crate version.

Trait Implementations§

Source§

impl Clone for ColorRole

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ColorRole

Source§

impl Debug for ColorRole

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ColorRole

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ColorRole

Source§

impl Hash for ColorRole

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ColorRole

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for ColorRole

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for ColorRole

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for ColorRole

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ColorRole

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.