#[non_exhaustive]pub enum ThemeVariant {
Light,
Dark,
HighContrast,
}Expand description
Which ambient mode a theme is written for.
The vocabulary’s own spelling of what makeover calls a theme’s variant,
and the duplication is deliberate rather than an oversight. This crate has
no dependencies by charter — it emits nothing, reads nothing and resolves
nothing — so it cannot take the crate that owns the file format, and a
renderer that must group a picker needs the three groups as values.
The two are kept in step by the app that converts between them, which is a
three-arm match at each adopter and the price of the layering. If a fourth
mode is ever authored, this enum and makeover::Variant move together.
Three, not two: one shipped theme is high contrast, and an app matching on light-or-dark alone files it under the wrong one.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Light
Written for a light ambient mode.
Dark
Written for a dark ambient mode.
HighContrast
Written to be legible before it is pretty.
Implementations§
Source§impl ThemeVariant
impl ThemeVariant
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The machine spelling, matching the theme file’s own meta.variant.
A data attribute, a stored value, a test assertion. Not a heading: what
a group is called on screen is heading.
Sourcepub const fn heading(self) -> &'static str
pub const fn heading(self) -> &'static str
What the group of themes in this variant is called on screen.
Here rather than at each renderer, which is the whole argument for the member existing: three renderers picking their own headings is one picker reading three ways, and the spellings below are the ones goingson’s shipped picker used before it was described.
Trait Implementations§
Source§impl Clone for ThemeVariant
impl Clone for ThemeVariant
Source§fn clone(&self) -> ThemeVariant
fn clone(&self) -> ThemeVariant
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more