#[non_exhaustive]pub enum Tint {
Accent,
Neutral,
Positive,
Warning,
Danger,
}Expand description
A semantic tint hint. Frontends map to theme-adaptive colours.
#[non_exhaustive]: a palette grows the same way an icon set does, so a
match needs a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl Tint
impl Tint
Sourcepub const ALL: &'static [Tint]
pub const ALL: &'static [Tint]
Every tint, so a frontend can assert its colour mapping is total —
for t in Tint::ALL { assert!(my_colour(*t).is_some()) } — instead of
keeping a second copy of this list that silently falls behind.
Icon deliberately has no equivalent, and the asymmetry is the point
rather than an oversight. Every other #[non_exhaustive] enum here is
safe against a new variant because this crate never produces one: it
defines the vocabulary, and every value in a workspace is constructed by
the embedder, so a new variant can only reach a match through a
deliberate, reviewed change to the producer. Tint is the one where
that gate is contingent — parse_vocabulary
does not read a per-term tint: today, but Term::tint
exists precisely so a vocabulary can say public reads green, and the
natural place to author that is beside the term in the document. The day
the parser learns that key, a Tint arrives from user data and the
gate becomes “someone edited a file”. This list has to already exist for
that change to turn consumer tests red instead of shipping a term that
silently renders untinted.