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<'de> Deserialize<'de> for Fill
impl<'de> Deserialize<'de> for Fill
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 Freeze for Fill
impl !RefUnwindSafe for Fill
impl Send for Fill
impl Sync for Fill
impl Unpin for Fill
impl UnsafeUnpin for Fill
impl !UnwindSafe 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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