pub enum Fill {
Color(Color),
Shader(Box<ShaderFill>),
LinearGradient(Box<LinearGradient>),
RadialGradient(Box<RadialGradient>),
ConicGradient(Box<ConicGradient>),
}Expand description
A paint source for backgrounds and text: a solid Color, a gradient or a custom shader.
A Color, LinearGradient, RadialGradient, ConicGradient or ShaderFill
all convert into a Fill automatically, so APIs that take an impl Into<Fill> accept
any of them directly:
let gradient: Fill = LinearGradient::new()
.stop((Color::RED, 0.0))
.stop((Color::BLUE, 100.0))
.into();Variants§
Color(Color)
A solid Color.
Shader(Box<ShaderFill>)
A custom SkSL shader. See ShaderFill.
LinearGradient(Box<LinearGradient>)
RadialGradient(Box<RadialGradient>)
ConicGradient(Box<ConicGradient>)
Implementations§
Trait Implementations§
Source§impl From<ConicGradient> for Fill
impl From<ConicGradient> for Fill
Source§fn from(gradient: ConicGradient) -> Self
fn from(gradient: ConicGradient) -> Self
Converts to this type from the input type.
Source§impl From<LinearGradient> for Fill
impl From<LinearGradient> for Fill
Source§fn from(gradient: LinearGradient) -> Self
fn from(gradient: LinearGradient) -> Self
Converts to this type from the input type.
Source§impl From<RadialGradient> for Fill
impl From<RadialGradient> for Fill
Source§fn from(gradient: RadialGradient) -> Self
fn from(gradient: RadialGradient) -> Self
Converts to this type from the input type.
Source§impl From<ShaderFill> for Fill
impl From<ShaderFill> for Fill
Source§fn from(shader: ShaderFill) -> Self
fn from(shader: ShaderFill) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Fill
Auto Trait Implementations§
impl !RefUnwindSafe for Fill
impl !UnwindSafe for Fill
impl Freeze for Fill
impl Send for Fill
impl Sync for Fill
impl Unpin for Fill
impl UnsafeUnpin for Fill
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more