Skip to main content

PaintRef

Type Alias PaintRef 

Source
pub type PaintRef<'a> = Paint<ImageBrushRef<'a>, &'a Gradient, &'a (dyn Any + Send + Sync)>;

Aliased Type§

pub enum PaintRef<'a> {
    Solid(AlphaColor<Srgb>),
    Gradient(&'a Gradient),
    Image(ImageBrush<&'a ImageData>),
    Resource(ImageBrush<ResourceId>),
    Custom(&'a (dyn Any + Send + Sync + 'static)),
}

Variants§

§

Solid(AlphaColor<Srgb>)

Solid color brush.

§

Gradient(&'a Gradient)

Gradient brush.

§

Image(ImageBrush<&'a ImageData>)

Image brush.

§

Resource(ImageBrush<ResourceId>)

Custom paint (referenced by ID)

§

Custom(&'a (dyn Any + Send + Sync + 'static))

Custom paint (type erased as each backend will have their own)

Trait Implementations§

Source§

impl<'a> From<&'a Paint> for PaintRef<'a>

Source§

fn from(paint: &'a Paint) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Brush<ImageBrush<&'a ImageData>, &'a Gradient>> for PaintRef<'a>

Source§

fn from(value: BrushRef<'a>) -> Self

Converts to this type from the input type.