pub struct GraphicsContext {Show 14 fields
pub foreground: Rgba,
pub alpha: Option<f64>,
pub antialiased: bool,
pub cap: CapStyle,
pub join: JoinStyle,
pub linewidth: f64,
pub dashes: Dashes,
pub clip_rect: Option<Bbox>,
pub clip_path: Option<ClipPath>,
pub hatch: Option<Hatch>,
pub snap: SnapMode,
pub sketch: Option<Sketch>,
pub url: Option<String>,
pub gid: Option<String>,
}Expand description
Everything about how a primitive is drawn, mirroring matplotlib’s
GraphicsContextBase. Lengths are in points unless stated otherwise;
coordinates are display pixels with the origin at the bottom left.
Fields§
§foreground: RgbaStroke colour.
alpha: Option<f64>When set, replaces the alpha of the stroke and fill colours.
antialiased: boolAnti-aliasing on/off.
cap: CapStyleLine end style.
join: JoinStyleLine join style.
linewidth: f64Line width in points (0 disables stroking).
dashes: DashesDash pattern in points.
clip_rect: Option<Bbox>Rectangular clip region in display coordinates.
clip_path: Option<ClipPath>Arbitrary clip region.
hatch: Option<Hatch>Hatch drawn over filled faces.
snap: SnapModePixel snapping.
sketch: Option<Sketch>Hand-drawn wobble.
url: Option<String>Hyperlink target (vector backends).
gid: Option<String>Group identifier (vector backends).
Implementations§
Source§impl GraphicsContext
impl GraphicsContext
Sourcepub fn stroke_color(&self) -> Rgba
pub fn stroke_color(&self) -> Rgba
The effective stroke colour (alpha override applied).
Sourcepub fn fill_color(&self, face: Rgba) -> Rgba
pub fn fill_color(&self, face: Rgba) -> Rgba
The effective colour for a face fill (alpha override applied).
Trait Implementations§
Source§impl Clone for GraphicsContext
impl Clone for GraphicsContext
Source§impl Debug for GraphicsContext
impl Debug for GraphicsContext
Source§impl Default for GraphicsContext
impl Default for GraphicsContext
Source§impl PartialEq for GraphicsContext
impl PartialEq for GraphicsContext
impl StructuralPartialEq for GraphicsContext
Auto Trait Implementations§
impl Forget for GraphicsContext
impl Freeze for GraphicsContext
impl Move for GraphicsContext
impl RefUnwindSafe for GraphicsContext
impl Send for GraphicsContext
impl Sync for GraphicsContext
impl Unpin for GraphicsContext
impl UnsafeUnpin for GraphicsContext
impl UnwindSafe for GraphicsContext
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
Mutably borrows from an owned value. Read more