Skip to main content

Backdrop

Struct Backdrop 

Source
pub struct Backdrop {
    pub surfaces: Vec<Color>,
    pub parts: Vec<Color>,
    pub text: Vec<Color>,
}
Expand description

What a ramp is drawn with in a theme, when it is known: the ramp is then fitted to it (Ramp::fitted).

Fields§

§surfaces: Vec<Color>

Where step 9 is drawn as text (an accent on panels, a keyword in an editor): it reaches FITTED_RATIO on each.

§parts: Vec<Color>

Where step 9 is drawn as a part to see (a slider’s fill on its track): it reaches 3:1 (3.1, for rounding) on each when the scheme’s direction allows.

§text: Vec<Color>

Text drawn on steps 3 to 5 (a selection): those steps move away from it until it reaches FITTED_RATIO.

Implementations§

Source§

impl Backdrop

Source

pub const SURFACES: &'static [&'static str]

Where an accent’s step 9 is drawn as text, in the contrast pairs: the surfaces, the editor’s background, and what a badge on the accent is written in.

Source

pub const PARTS: &'static [&'static str]

Where it is drawn as a part to see: a slider’s and a progress bar’s track.

Source

pub const TEXT: &'static [&'static str]

The text drawn on its quiet steps (the selection is step 5).

Source

pub fn from_tokens(color: impl Fn(&str) -> Option<Color>) -> Backdrop

The backdrop of an accent in a theme, its colours read by path (Backdrop::SURFACES, Backdrop::PARTS, Backdrop::TEXT); a path without a colour is left out.

Trait Implementations§

Source§

impl Clone for Backdrop

Source§

fn clone(&self) -> Backdrop

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Backdrop

Source§

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

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

impl Default for Backdrop

Source§

fn default() -> Backdrop

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

impl PartialEq for Backdrop

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Backdrop

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.