Skip to main content

ColorRoles

Struct ColorRoles 

Source
#[repr(C)]
pub struct ColorRoles {
Show 28 fields pub background: Option<Rgb>, pub surface: Option<Rgb>, pub surface_bar: Option<Rgb>, pub surface_muted: Option<Rgb>, pub on_surface: Option<Rgb>, pub on_surface_variant: Option<Rgb>, pub outline: Option<Rgb>, pub outline_variant: Option<Rgb>, pub primary: Option<Rgb>, pub on_primary: Option<Rgb>, pub primary_text: Option<Rgb>, pub secondary_container: Option<Rgb>, pub on_secondary_container: Option<Rgb>, pub fab: Option<Rgb>, pub on_fab: Option<Rgb>, pub success: Option<TonePair>, pub warning: Option<TonePair>, pub danger: Option<TonePair>, pub info: Option<TonePair>, pub scrim: Option<Rgba>, pub selection: Option<Rgb>, pub error: Option<Rgb>, pub error_fill: Option<Rgb>, pub on_error_fill: Option<Rgb>, pub outlined_fill: Option<Rgba>, pub outlined_border: Option<Rgba>, pub segment_selected: Option<Rgb>, pub on_segment_selected: Option<Rgb>,
}
Expand description

Colour roles; every one optional (None = the shell’s current colour for that role).

Fields§

§background: Option<Rgb>

Page background.

§surface: Option<Rgb>

Cards, sheets, dialogs.

§surface_bar: Option<Rgb>

Top bar, bottom navigation, navigation rail.

§surface_muted: Option<Rgb>

Chips, input fills, segmented track, Filled cards, skeletons, the Neutral tone.

§on_surface: Option<Rgb>

Text and icons.

§on_surface_variant: Option<Rgb>

Secondary text (captions, unselected tabs).

§outline: Option<Rgb>

Field and outlined-button borders.

§outline_variant: Option<Rgb>

Hairlines and dividers.

§primary: Option<Rgb>

Filled buttons, selected calendar day, toggles (unless selection is set).

§on_primary: Option<Rgb>§primary_text: Option<Rgb>

Primary-coloured text/icons on the background (text buttons, selected tab, back button).

§secondary_container: Option<Rgb>

Tonal buttons, selected segment/chip, navigation indicator.

§on_secondary_container: Option<Rgb>§fab: Option<Rgb>§on_fab: Option<Rgb>§success: Option<TonePair>

One container/on-container pair per Tone. Filled toned buttons swap the pair (Danger: unless error_fill is set).

§warning: Option<TonePair>§danger: Option<TonePair>§info: Option<TonePair>§scrim: Option<Rgba>

Sheet and dialog scrim.

§selection: Option<Rgb>

Focus and selection marks: the focused field’s border, label and cursor, checked toggles and checkboxes, sliders, progress. Unset: the shell’s current colour (primary on most shells).

§error: Option<Rgb>

Error text and the invalid field’s border; outlined and text Danger buttons. Unset: danger’s on-container colour, as before.

§error_fill: Option<Rgb>

A filled Danger button’s background. Unset: the danger pair, swapped, as before.

§on_error_fill: Option<Rgb>

A filled Danger button’s text. Unset: as before.

§outlined_fill: Option<Rgba>

An outlined button’s background (alpha allowed: a soft tint). Unset: transparent, as before.

§outlined_border: Option<Rgba>

An outlined button’s border (alpha allowed). Unset: outline, as before.

§segment_selected: Option<Rgb>

The selected segment’s fill, apart from chips and tonal buttons. Unset: secondary_container, as before.

§on_segment_selected: Option<Rgb>

The selected segment’s text and check mark. Unset: on_secondary_container, as before.

Trait Implementations§

Source§

impl Clone for ColorRoles

Source§

fn clone(&self) -> ColorRoles

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 ColorRoles

Source§

impl Debug for ColorRoles

Source§

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

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

impl Default for ColorRoles

Source§

fn default() -> ColorRoles

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ColorRoles

Source§

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

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

impl Eq for ColorRoles

Source§

impl<'ʄ> Facet<'ʄ> for ColorRoles

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more
Source§

impl PartialEq for ColorRoles

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ColorRoles

Source§

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

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

impl StructuralPartialEq for ColorRoles

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

type Output = T

Should always be Self
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.