pub enum Paint {
Solid {
color: Color,
},
Gradient(GradientPaint),
}Expand description
How a filled region is painted.
Every fill command carries a Paint, so any geometry (rectangle, rounded
rectangle, ellipse, polygon, …) can be filled with a flat color or a
gradient through one uniform model — there is no per-geometry gradient
command. New fill kinds (e.g. patterns) are added here as one more variant,
and the exhaustive matches over Paint force every backend to handle them.
Serialized internally-tagged on kind so the JSON is self-describing:
{ "kind": "solid", "color": {…} } or
{ "kind": "gradient", "angle_deg": …, "stops": [...] }.
Variants§
Implementations§
Trait Implementations§
impl StructuralPartialEq for Paint
Auto Trait Implementations§
impl Freeze for Paint
impl RefUnwindSafe for Paint
impl Send for Paint
impl Sync for Paint
impl Unpin for Paint
impl UnsafeUnpin for Paint
impl UnwindSafe for Paint
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