Struct Intents
pub struct Intents {
pub accent: AlphaColor<Srgb>,
pub accent_hover: AlphaColor<Srgb>,
pub accent_pressed: AlphaColor<Srgb>,
pub on_accent: AlphaColor<Srgb>,
pub accent_ink: AlphaColor<Srgb>,
pub on_state: AlphaColor<Srgb>,
pub on_state_mark: AlphaColor<Srgb>,
pub value_fill: AlphaColor<Srgb>,
pub selection: AlphaColor<Srgb>,
pub selection_hover: AlphaColor<Srgb>,
pub you: AlphaColor<Srgb>,
pub selection_tint: AlphaColor<Srgb>,
}Expand description
What controls paint with, by intent rather than by hue
(docs/design-language.md, “Colour roles”). Nothing outside these roles
gets colour: the accent is for primary actions, links, the focus ring,
the caret, the text selection and the selected row’s tint; the on state
is for a switch, a checked box or radio, an active tile, a “connected”
dot. Hover, resize grips, window edges, icons at rest, sliders and
progress stay neutral.
Fields§
§accent: AlphaColor<Srgb>Fill of a primary action: the accent hue at a lightness its label
reads on (Emphasis::You and Emphasis::Tinted), or primary ink
inverted onto the control under Emphasis::Inverted.
accent_hover: AlphaColor<Srgb>Self::accent under the pointer: a step away from its label, so
hover only ever adds contrast.
accent_pressed: AlphaColor<Srgb>Self::accent while pressed: a step past the rest fill the other
way from hover, so a press never reads as a hover.
on_accent: AlphaColor<Srgb>Label and glyph on an Self::accent fill.
accent_ink: AlphaColor<Srgb>The accent as ink and as a mark on a surface: a link, the focus ring, the caret, the text-selection wash. Clears body-text contrast on the window.
on_state: AlphaColor<Srgb>Fill of a control that is on: a switch’s track, a checked box or radio, an active Quick Settings tile, a “connected” dot. Green, the colour people read as “on”; state, not status, and never the accent.
on_state_mark: AlphaColor<Srgb>The knob or mark standing on Self::on_state.
value_fill: AlphaColor<Srgb>A value that is neither on nor an action: a slider’s filled track,
a progress bar, a gauge, a spinner, a chart’s default series, a
finished step. The accent as a mark (Self::accent_ink), held to
the non-text contrast floor on the ground it stands on; never the
text colour, so a filled bar never reads as a black slab.
selection: AlphaColor<Srgb>A selected row, tab or segment on the content surface: one surface
step, faintly the accent (colourless under Emphasis::Inverted).
Other grounds lift with Colors::lift_on.
selection_hover: AlphaColor<Srgb>Halfway to Self::selection: an unselected row under the pointer.
you: AlphaColor<Srgb>The local person’s presence colour: the colour collaborators see their cursor, caret and selection in.
selection_tint: AlphaColor<Srgb>Text-selection wash: Self::accent_ink at low alpha, painted under
the selected glyphs.
Trait Implementations§
impl Copy for Intents
impl StructuralPartialEq for Intents
Auto Trait Implementations§
impl Freeze for Intents
impl RefUnwindSafe for Intents
impl Send for Intents
impl Sync for Intents
impl Unpin for Intents
impl UnsafeUnpin for Intents
impl UnwindSafe for Intents
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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