#[non_exhaustive]pub struct Tones {Show 25 fields
pub content: Option<Color>,
pub secondary: Option<Color>,
pub muted: Option<Color>,
pub disabled: Option<Color>,
pub action: Option<Color>,
pub on_action: Option<Color>,
pub info: Option<Color>,
pub success: Option<Color>,
pub warning: Option<Color>,
pub danger: Option<Color>,
pub info_surface: Option<Color>,
pub success_surface: Option<Color>,
pub warning_surface: Option<Color>,
pub danger_surface: Option<Color>,
pub neutral_surface: Option<Color>,
pub border: Option<Color>,
pub sunken: Option<Color>,
pub ground: Option<Color>,
pub stripe: Option<Color>,
pub selected: Option<Color>,
pub heat_0: Option<Color>,
pub heat_1: Option<Color>,
pub heat_2: Option<Color>,
pub heat_3: Option<Color>,
pub heat_4: Option<Color>,
}Expand description
The colours text, controls and tables are drawn in.
Each is optional, and an empty one is a real answer: the terminal’s own
ink. Where a role has no colour, the drawing says it with a modifier
instead (muted text dims, a danger line is bold, a link is underlined, the
cursor row is reversed), which is what a terminal with no colour to spend
has left. Tones::NONE is that terminal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content: Option<Color>Ordinary content, and what a neutral tone reads as. content-primary.
secondary: Option<Color>Content one step back: a field’s label, a column heading. content-secondary.
muted: Option<Color>Content two steps back: a caption, a hint, a reading. content-muted.
disabled: Option<Color>The label of a control that will not answer, fainter than any hint.
content-disabled.
action: Option<Color>Text that goes somewhere, and a control’s label. action-primary.
on_action: Option<Color>Text legible on action, for a control filled with it.
info: Option<Color>Something worth knowing and nothing to do about it. status-info.
success: Option<Color>Something finished and it worked. status-success.
warning: Option<Color>Something the user should look at. status-warning.
danger: Option<Color>Something broken, or about to be destroyed. status-danger.
info_surface: Option<Color>The fill of an info badge. info-surface.
success_surface: Option<Color>The fill of a success badge. success-surface.
warning_surface: Option<Color>The fill of a warning badge. warning-surface.
danger_surface: Option<Color>The fill of a danger badge. danger-surface.
neutral_surface: Option<Color>The fill of a neutral badge. row-hover, the weight the tone fills sit at.
border: Option<Color>A neutral badge’s edge. line-border.
sunken: Option<Color>A surface set back from the one it sits on: a code run, a table’s heading strip. surface-sunken.
ground: Option<Color>What a table’s rows sit on. surface-raised.
stripe: Option<Color>What every second table row sits on. surface-page: a step of the
theme’s neutral ramp, not a tone of its own.
selected: Option<Color>The row under the cursor. row-selected.
heat_0: Option<Color>The measure ramp’s fills, quietest first: heat-0 to heat-4. A
background and never an ink, read through
Ink::heat.
heat_1: Option<Color>heat-1.
heat_2: Option<Color>heat-2.
heat_3: Option<Color>heat-3.
heat_4: Option<Color>heat-4.
Implementations§
Source§impl Tones
impl Tones
Sourcepub const NONE: Self
pub const NONE: Self
No colours at all: every role drawn in the terminal’s own ink, and carried by modifiers.
Sourcepub const fn info_surface(self, color: Color) -> Self
pub const fn info_surface(self, color: Color) -> Self
Set info_surface.
Sourcepub const fn success_surface(self, color: Color) -> Self
pub const fn success_surface(self, color: Color) -> Self
Set success_surface.
Sourcepub const fn warning_surface(self, color: Color) -> Self
pub const fn warning_surface(self, color: Color) -> Self
Set warning_surface.
Sourcepub const fn danger_surface(self, color: Color) -> Self
pub const fn danger_surface(self, color: Color) -> Self
Set danger_surface.
Sourcepub const fn neutral_surface(self, color: Color) -> Self
pub const fn neutral_surface(self, color: Color) -> Self
Set neutral_surface.
Trait Implementations§
impl Copy for Tones
impl Eq for Tones
impl StructuralPartialEq for Tones
Auto Trait Implementations§
impl Forget for Tones
impl Freeze for Tones
impl Move for Tones
impl RefUnwindSafe for Tones
impl Send for Tones
impl Sync for Tones
impl Unpin for Tones
impl UnsafeUnpin for Tones
impl UnwindSafe for Tones
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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