Skip to main content

MaterialAccentColor

Struct MaterialAccentColor 

Source
pub struct MaterialAccentColor { /* private fields */ }
Expand description

Defines a single accent color as well a swatch of four shades of the accent color.

The color’s shades are referred to by index, the colors with smaller indices are lighter, larger indices are darker. There are four valid indices: 100, 200, 400, and 700. The value of this color should be the same as the value of index 200 and shade200.

See also:

Implementations§

Source§

impl MaterialAccentColor

Source

pub fn new( primary: Color, swatch: impl IntoIterator<Item = (i32, Color)>, ) -> MaterialAccentColor

Creates a color swatch with a variety of shades appropriate for accent colors.

Source

pub const fn from_static( primary: Color, swatch: &'static [(i32, Color)], ) -> MaterialAccentColor

Dart’s const MaterialAccentColor(primary, {...}), for a table written in the source.

Source

pub fn shade100(&self) -> Color

The lightest shade.

Source

pub fn shade200(&self) -> Color

The default shade.

Source

pub fn shade400(&self) -> Color

The second darkest shade.

Source

pub fn shade700(&self) -> Color

The darkest shade.

Source

pub fn into_any(self) -> AnyColor

The swatch as the Color it is in Dart.

Methods from Deref<Target = ColorSwatch<i32>>§

Source

pub fn primary(&self) -> Color

The primary color: what Dart’s swatch is, as a Color.

Source

pub fn get(&self, key: &T) -> Option<Color>

Returns an element of the swatch table.

Source

pub fn keys(&self) -> impl Iterator<Item = &T>

Returns the valid keys for accessing operator[].

Trait Implementations§

Source§

impl Clone for MaterialAccentColor

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 ColorExtension for MaterialAccentColor

Source§

fn as_any(&self) -> &dyn Any

The extension as Any, for Dart’s is checks (AnyColor::extension).
Source§

fn eq_extension(&self, other: &dyn ColorExtension) -> bool

Dart’s == override on the subclass, called once the values compared equal. other is the same runtime type when it downcasts; any other type is unequal, as Dart’s runtimeType check makes it.
Source§

impl Debug for MaterialAccentColor

Source§

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

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

impl Deref for MaterialAccentColor

Source§

type Target = ColorSwatch<i32>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &ColorSwatch<i32>

Dereferences the value.
Source§

impl From<MaterialAccentColor> for AnyColor

Source§

fn from(color: MaterialAccentColor) -> AnyColor

Converts to this type from the input type.
Source§

impl PartialEq for MaterialAccentColor

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 StructuralPartialEq for MaterialAccentColor

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,