pub enum FillPattern {
Stripe {
fg: (u8, u8, u8),
bg: (u8, u8, u8),
size_px: f64,
angle_deg: f64,
},
}Expand description
A pattern fill for an area that has no single colour to draw — today
just a scale’s na_pattern (#206): ScaleFillBinned::na_pattern,
drawn instead of na_value’s flat colour by geom_sf/geom_polygon/
geom_rect/geom_tile and the legend’s “no data” key, so a classed
choropleth’s no-data cells read as “we have no reading here” rather
than a greyed-out value easily mistaken for one.
fg stripes run at angle_deg (0 = horizontal, measured the usual
screen way, clockwise from the x axis), each size_px wide, over a
bg field — fg fills the first 30% of each cycle, bg the rest, a
thin hatch rather than an even 50/50 stripe (ggplot2/R’s own
pattern_stripe(density = 0.3) default). More pattern kinds can join
this enum later without breaking callers that match it today only via
FillPattern::bg/FillPattern::color_at.
Variants§
Stripe
Implementations§
Source§impl FillPattern
impl FillPattern
Sourcepub fn stripe(fg: (u8, u8, u8), bg: (u8, u8, u8)) -> FillPattern
pub fn stripe(fg: (u8, u8, u8), bg: (u8, u8, u8)) -> FillPattern
A reasonable default stripe: fg/bg as given, 4px period, 45°.
Trait Implementations§
Source§impl Clone for FillPattern
impl Clone for FillPattern
impl Copy for FillPattern
Source§impl Debug for FillPattern
impl Debug for FillPattern
Source§impl PartialEq for FillPattern
impl PartialEq for FillPattern
impl StructuralPartialEq for FillPattern
Auto Trait Implementations§
impl Freeze for FillPattern
impl RefUnwindSafe for FillPattern
impl Send for FillPattern
impl Sync for FillPattern
impl Unpin for FillPattern
impl UnsafeUnpin for FillPattern
impl UnwindSafe for FillPattern
Blanket Implementations§
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,
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