pub struct Stroke<'a> {
pub style: Style,
pub width: f32,
pub line_cap: LineCap,
pub line_join: LineJoin,
pub line_dash: LineDash<'a>,
}
Available on crate feature
canvas
only.Expand description
The style of a stroke.
Fields§
§style: Style
The color or gradient of the stroke.
By default, it is set to a Style::Solid
with Color::BLACK
.
width: f32
The distance between the two edges of the stroke.
line_cap: LineCap
The shape to be used at the end of open subpaths when they are stroked.
line_join: LineJoin
The shape to be used at the corners of paths or basic shapes when they are stroked.
line_dash: LineDash<'a>
The dash pattern used when stroking the line.
Implementations§
§impl<'a> Stroke<'a>
impl<'a> Stroke<'a>
pub fn with_color(self, color: Color) -> Stroke<'a>
pub fn with_color(self, color: Color) -> Stroke<'a>
Sets the color of the Stroke
.
pub fn with_width(self, width: f32) -> Stroke<'a>
pub fn with_width(self, width: f32) -> Stroke<'a>
Sets the width of the Stroke
.
pub fn with_line_cap(self, line_cap: LineCap) -> Stroke<'a>
pub fn with_line_cap(self, line_cap: LineCap) -> Stroke<'a>
pub fn with_line_join(self, line_join: LineJoin) -> Stroke<'a>
pub fn with_line_join(self, line_join: LineJoin) -> Stroke<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Stroke<'a>
impl<'a> Send for Stroke<'a>
impl<'a> Sync for Stroke<'a>
impl<'a> Unpin for Stroke<'a>
impl<'a> UnwindSafe for Stroke<'a>
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more