pub enum Paint {
Solid(Color),
Linear {
start: Point,
end: Point,
stops: Vec<GradientStop>,
extend: (bool, bool),
},
Radial {
center: Point,
radius: f64,
focal: Point,
stops: Vec<GradientStop>,
extend: (bool, bool),
},
Grid {
bounds: Rect,
columns: u16,
rows: u16,
colors: Vec<Color>,
},
Tile {
image: MediaId,
tile: Rect,
transform: Transform,
},
}Expand description
Fill or stroke paint independent of a rendering backend.
Variants§
Solid(Color)
Linear
Radial
Grid
A source-derived colour grid, repeated over its physical tile bounds. Path gradients use one tile covering the complete painted owner.
Tile
Implementations§
Source§impl Paint
impl Paint
Sourcepub fn grid(
bounds: Rect,
columns: u16,
rows: u16,
colors: Vec<Color>,
) -> Option<Self>
pub fn grid( bounds: Rect, columns: u16, rows: u16, colors: Vec<Color>, ) -> Option<Self>
Validate a bounded colour grid before publishing backend-neutral paint.
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