[][src]Struct embedded_graphics::style::PrimitiveStyle

#[non_exhaustive]pub struct PrimitiveStyle<C> where
    C: PixelColor
{ pub fill_color: Option<C>, pub stroke_color: Option<C>, pub stroke_width: u32, }

Style properties for primitives.

PrimitiveStyle can be applied to a primitive to define how the primitive is drawn.

Because PrimitiveStyle has the non_exhaustive attribute, it cannot be created using a struct literal. To create a PrimitiveStyle, use the primitive_style! macro or PrimitiveStyleBuilder.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
fill_color: Option<C>

Fill color of the primitive.

If fill_color is set to None no fill will be drawn.

stroke_color: Option<C>

Stroke color of the primitive.

If stroke_color is set to None or the stroke_width is set to 0 no stroke will be drawn.

stroke_width: u32

Stroke width in pixels.

Methods

impl<C> PrimitiveStyle<C> where
    C: PixelColor
[src]

pub fn new() -> Self[src]

Creates a primitive style without fill and stroke.

pub fn with_stroke(stroke_color: C, stroke_width: u32) -> Self[src]

Creates a stroke primitive style.

If the stroke_width is 0 the resulting style won't draw a stroke.

pub fn with_fill(fill_color: C) -> Self[src]

Creates a fill primitive style.

Trait Implementations

impl<C: Clone> Clone for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: Copy> Copy for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: Debug> Debug for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C> Default for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: Eq> Eq for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: Hash> Hash for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: Ord> Ord for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: PartialEq> PartialEq<PrimitiveStyle<C>> for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C: PartialOrd> PartialOrd<PrimitiveStyle<C>> for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C> StructuralEq for PrimitiveStyle<C> where
    C: PixelColor
[src]

impl<C> StructuralPartialEq for PrimitiveStyle<C> where
    C: PixelColor
[src]

Auto Trait Implementations

impl<C> Send for PrimitiveStyle<C> where
    C: Send

impl<C> Sync for PrimitiveStyle<C> where
    C: Sync

impl<C> Unpin for PrimitiveStyle<C> where
    C: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,