Struct PartTokens
pub struct PartTokens {Show 18 fields
pub fill: AlphaColor<Srgb>,
pub ink: AlphaColor<Srgb>,
pub edge: AlphaColor<Srgb>,
pub ground: AlphaColor<Srgb>,
pub raised: AlphaColor<Srgb>,
pub accent: AlphaColor<Srgb>,
pub light: AlphaColor<Srgb>,
pub radius: f32,
pub border_width: f32,
pub border: AlphaColor<Srgb>,
pub scale: f32,
pub dark: bool,
pub high_contrast: bool,
pub reduce_transparency: bool,
pub backdrop: bool,
pub params: Arc<[Param]>,
pub shader: ShaderSource,
pub flush: Sides,
}Expand description
The theme’s values for one part, resolved for its role and state: the
colours already carry the theme’s contrast guarantees, so a painter that
lays ink on fill is legible.
Fields§
§fill: AlphaColor<Srgb>The part’s own fill: a control’s face, a panel’s ground, as its role and state resolved it.
ink: AlphaColor<Srgb>The ink drawn on fill.
edge: AlphaColor<Srgb>The part’s edge, where the design language gives it one.
ground: AlphaColor<Srgb>The ground the part stands on.
raised: AlphaColor<Srgb>One surface step above ground: a hover’s or a rest control’s lift.
accent: AlphaColor<Srgb>The person’s accent.
light: AlphaColor<Srgb>The light a surface catches: the theme’s daylight, at no chroma, for
a sheen across a body or a rim lit along its edge. How strongly a
part catches it is the part’s own (specular, edge_highlight).
radius: f32Corner radius, logical pixels.
border_width: f32The theme’s border, logical pixels wide; 0 for none.
border: AlphaColor<Srgb>The border’s colour.
scale: f32Device pixels per logical pixel, so a painter can draw to the pixel grid (pixel edges, a dither aligned to the screen).
dark: bool§high_contrast: bool§reduce_transparency: boolNothing may be translucent: a crate::Brush::Backdrop shows its
fallback.
backdrop: boolA crate::Brush::Backdrop shows what lies below the part this
frame: its role takes a backdrop (floating chrome, a bar), nothing
forbids translucency, and the toolkit runs a backdrop pass. Where
not, a backdrop brush is its fallback, and a painter may draw the
part opaque its own way instead.
params: Arc<[Param]>The painter set’s own parameters from the theme document, as its
ParamSpecs declare them.
shader: ShaderSourceThe theme’s own surface shader (crate::Brush::Shader), empty for a
set that draws without one: the toolkit replaces the marker fill
with the evaluated shader. A theme’s document is validated when it is
read, so a shader here has already been checked.
flush: SidesThe sides standing on the display’s own edge, where a body draws no
edge of its own and a rim does not light (Sides).
Implementations§
Trait Implementations§
§impl Clone for PartTokens
impl Clone for PartTokens
§fn clone(&self) -> PartTokens
fn clone(&self) -> PartTokens
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PartTokens
impl Debug for PartTokens
§impl Default for PartTokens
impl Default for PartTokens
§fn default() -> PartTokens
fn default() -> PartTokens
§impl PartialEq for PartTokens
impl PartialEq for PartTokens
impl StructuralPartialEq for PartTokens
Auto Trait Implementations§
impl Freeze for PartTokens
impl RefUnwindSafe for PartTokens
impl Send for PartTokens
impl Sync for PartTokens
impl Unpin for PartTokens
impl UnsafeUnpin for PartTokens
impl UnwindSafe for PartTokens
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