#[non_exhaustive]pub enum Contrast {
Low,
Standard,
High,
}Expand description
How legible a theme measured, as a picker reports it.
A measurement carried into the description, which is unusual here and is the one case that earns it: the number comes off the theme’s resolved colours, so the layer that loaded the theme is the only party that has it, and an app re-deriving it would be parsing every theme file a second time to learn what was already known. What a renderer does with it is a badge beside the name.
Ordered worst-first, matching makeover::ContrastTier, so the two sort the
same way and an adopter’s match cannot invert an ordering by accident.
Added 0.38.0.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Low
Muted text below the 3:1 floor for large text and UI parts.
Standard
Muted text clears 3:1 but not the 4.5:1 bar for normal text.
High
Muted text meets WCAG AA on every panel ground.
Implementations§
Source§impl Contrast
impl Contrast
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The machine spelling, for a data attribute or a test.
Sourcepub const fn badge(self) -> &'static str
pub const fn badge(self) -> &'static str
The short mark shown beside a theme’s name.
One spelling for the tree, for ThemeVariant::heading’s reason. These
are the marks audiofiles shipped before its picker was described, which
is the only implementation that ever drew them.
Standard is not the absence of a mark: a reader
scanning a column of badges learns more from three marks than from two
and a gap, and “OK” is the honest reading of a theme that clears the UI
floor and misses the text one.