Skip to main content

VectorBuilder

Trait VectorBuilder 

Source
pub trait VectorBuilder: Sized {
    // Required methods
    fn tint<M>(self, color: impl IntoReactive<Color, M>) -> Self;
    fn weight(self, w: VectorWeight) -> Self;
    fn decorative(self) -> Self;
    fn template(self) -> Self;
}
Expand description

Builder methods of Vector, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.

Required Methods§

Source

fn tint<M>(self, color: impl IntoReactive<Color, M>) -> Self

Recolor the glyph (monochrome art) where the backend supports tinting.

Takes a plain Color or anything reactive: a signal or closure repaints the realized glyph through ImagePatch::Tint instead of rebuilding it, so a glyph that follows the selection or the theme keeps its native view.

Source

fn weight(self, w: VectorWeight) -> Self

Select the glyph’s weight (template-form sources render true weights; plain SVGs degrade to Regular; see VectorWeight).

Source

fn decorative(self) -> Self

Mark the glyph decorative (hidden from accessibility).

Source

fn template(self) -> Self

Draw the glyph as a template (docs/vectors.md “Template”): untinted, it takes the foreground of the surface it sits on and follows the theme, instead of its authored colors. A .tint(…) still wins while it is set.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl VectorBuilder for Vector

Source§

impl<DecoratedInner: VectorBuilder + Piece> VectorBuilder for Decorated<DecoratedInner>

Day API ↩ Guides· daybrite.dev