[−][src]Struct embedded_graphics::style::PrimitiveStyle
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)
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]
C: PixelColor,
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]
C: PixelColor,
fn clone(&self) -> PrimitiveStyle<C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<C: Copy> Copy for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: Debug> Debug for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C> Default for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: Eq> Eq for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C: Hash> Hash for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<C: Ord> Ord for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
fn cmp(&self, other: &PrimitiveStyle<C>) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<C: PartialEq> PartialEq<PrimitiveStyle<C>> for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
fn eq(&self, other: &PrimitiveStyle<C>) -> bool
[src]
fn ne(&self, other: &PrimitiveStyle<C>) -> bool
[src]
impl<C: PartialOrd> PartialOrd<PrimitiveStyle<C>> for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
fn partial_cmp(&self, other: &PrimitiveStyle<C>) -> Option<Ordering>
[src]
fn lt(&self, other: &PrimitiveStyle<C>) -> bool
[src]
fn le(&self, other: &PrimitiveStyle<C>) -> bool
[src]
fn gt(&self, other: &PrimitiveStyle<C>) -> bool
[src]
fn ge(&self, other: &PrimitiveStyle<C>) -> bool
[src]
impl<C> StructuralEq for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
impl<C> StructuralPartialEq for PrimitiveStyle<C> where
C: PixelColor,
[src]
C: PixelColor,
Auto Trait Implementations
impl<C> Send for PrimitiveStyle<C> where
C: Send,
C: Send,
impl<C> Sync for PrimitiveStyle<C> where
C: Sync,
C: Sync,
impl<C> Unpin for PrimitiveStyle<C> where
C: Unpin,
C: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,