1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Style;

use super::{Fill, Shape, Stroke};

/// An extension trait with various convenience methods for shapes.
pub trait ShapeExt: Sized {
    fn fill(self, style: impl Into<Style>) -> Fill<Self> {
        Fill::new(self, style.into())
    }

    fn stroke(self, style: impl Into<Style>) -> Stroke<Self> {
        Stroke::new(self, style.into())
    }
}

impl<T> ShapeExt for T where T: Shape {}