Skip to main content

SystemColor

Enum SystemColor 

Source
pub enum SystemColor {
Show 19 variants Red, Orange, Yellow, Green, Mint, Teal, Cyan, Blue, Indigo, Accent, Purple, Pink, Brown, White, Gray, Black, Clear, Primary, Secondary,
}
Expand description

One of SwiftUI’s own named colours.

These are not RGB triples, which is the trap. Color.blue is a semantic system colour that resolves through the current appearance; under aqua it is around (0, 0.48, 1), nowhere near the literal (0, 0, 1) a constant in this crate spells. Building a colour from components and calling it blue renders a visibly different blue — close enough to look right on its own and wrong beside the real thing.

Variants§

§

Red

§

Orange

§

Yellow

§

Green

§

Mint

§

Teal

§

Cyan

§

Blue

§

Indigo

§

Accent

§

Purple

§

Pink

§

Brown

§

White

§

Gray

§

Black

§

Clear

§

Primary

§

Secondary

Trait Implementations§

Source§

impl BackgroundStyleArg for SystemColor

Source§

fn background_style(self, view: View) -> View

Apply this style as view’s background style.
Source§

impl Clone for SystemColor

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 SystemColor

Source§

impl Debug for SystemColor

Source§

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

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

impl Eq for SystemColor

Source§

impl From<Accent> for SystemColor

Source§

fn from(_: Accent) -> Self

Converts to this type from the input type.
Source§

impl From<Black> for SystemColor

Source§

fn from(_: Black) -> Self

Converts to this type from the input type.
Source§

impl From<Blue> for SystemColor

Source§

fn from(_: Blue) -> Self

Converts to this type from the input type.
Source§

impl From<Brown> for SystemColor

Source§

fn from(_: Brown) -> Self

Converts to this type from the input type.
Source§

impl From<Clear> for SystemColor

Source§

fn from(_: Clear) -> Self

Converts to this type from the input type.
Source§

impl From<Cyan> for SystemColor

Source§

fn from(_: Cyan) -> Self

Converts to this type from the input type.
Source§

impl From<Gray> for SystemColor

Source§

fn from(_: Gray) -> Self

Converts to this type from the input type.
Source§

impl From<Green> for SystemColor

Source§

fn from(_: Green) -> Self

Converts to this type from the input type.
Source§

impl From<Indigo> for SystemColor

Source§

fn from(_: Indigo) -> Self

Converts to this type from the input type.
Source§

impl From<Mint> for SystemColor

Source§

fn from(_: Mint) -> Self

Converts to this type from the input type.
Source§

impl From<Orange> for SystemColor

Source§

fn from(_: Orange) -> Self

Converts to this type from the input type.
Source§

impl From<Pink> for SystemColor

Source§

fn from(_: Pink) -> Self

Converts to this type from the input type.
Source§

impl From<Primary> for SystemColor

Source§

fn from(_: Primary) -> Self

Converts to this type from the input type.
Source§

impl From<Purple> for SystemColor

Source§

fn from(_: Purple) -> Self

Converts to this type from the input type.
Source§

impl From<Red> for SystemColor

Source§

fn from(_: Red) -> Self

Converts to this type from the input type.
Source§

impl From<Secondary> for SystemColor

Source§

fn from(_: Secondary) -> Self

Converts to this type from the input type.
Source§

impl From<Teal> for SystemColor

Source§

fn from(_: Teal) -> Self

Converts to this type from the input type.
Source§

impl From<White> for SystemColor

Source§

fn from(_: White) -> Self

Converts to this type from the input type.
Source§

impl From<Yellow> for SystemColor

Source§

fn from(_: Yellow) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for SystemColor

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 ShapeStyleArg for SystemColor

Source§

fn foreground_style(self, view: View) -> View

Apply this style to view.
Source§

impl StructuralPartialEq for SystemColor

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<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.