pub struct ThemeFamily {
pub name: String,
pub author: Option<String>,
pub dark: Option<Variant>,
pub light: Option<Variant>,
}Expand description
One theme family, as a file declares it:
name = "Gruvbox"
[dark]
bg = "#282828"
text = "#ebdbb2"
[dark.syntax]
keyword = "#fb4934"
[light.seed]
surface = "#fbf1c7"
ink = "#3c3836"
accent = "#076678"Keys are the names Theme::tokens_mut gives; a nested table joins its
key onto its parent’s with a dot, so [dark.syntax] keyword is
syntax.keyword. Values are #rrggbb or #rrggbbaa. A seed table is a
Seed, applied before the variant’s tokens.
A family has at least one variant; deserializing one with neither fails.
Fields§
§name: String§dark: Option<Variant>§light: Option<Variant>Implementations§
Source§impl ThemeFamily
impl ThemeFamily
Sourcepub fn bundled() -> &'static [ThemeFamily]
pub fn bundled() -> &'static [ThemeFamily]
Every bundled family, in file-name order.
Sourcepub fn named(name: &str) -> Option<&'static ThemeFamily>
pub fn named(name: &str) -> Option<&'static ThemeFamily>
The bundled family name names, ignoring case.
Sourcepub fn variant(&self, appearance: Appearance) -> Option<&Variant>
pub fn variant(&self, appearance: Appearance) -> Option<&Variant>
The variant for appearance, if the family has one.
Sourcepub fn theme(&self, appearance: Appearance) -> Option<Theme>
pub fn theme(&self, appearance: Appearance) -> Option<Theme>
The shipped palette for appearance with this family’s variant laid
over it, carrying the family’s name in Theme::family. None when
the family has no variant for appearance.
Trait Implementations§
Source§impl Clone for ThemeFamily
impl Clone for ThemeFamily
Source§impl Debug for ThemeFamily
impl Debug for ThemeFamily
Source§impl<'de> Deserialize<'de> for ThemeFamily
impl<'de> Deserialize<'de> for ThemeFamily
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ThemeFamily
impl RefUnwindSafe for ThemeFamily
impl Send for ThemeFamily
impl Sync for ThemeFamily
impl Unpin for ThemeFamily
impl UnsafeUnpin for ThemeFamily
impl UnwindSafe for ThemeFamily
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more