pub enum Paint {
Solid {
color: Rgba,
},
LinearGradient {
start: Vec2,
end: Vec2,
stops: Vec<GradientStop>,
spread: Spread,
},
RadialGradient {
center: Vec2,
radius: f32,
stops: Vec<GradientStop>,
spread: Spread,
},
ConicGradient {
center: Vec2,
angle_degrees: f32,
stops: Vec<GradientStop>,
},
}Expand description
A color or gradient.
Gradients interpolate between stops premultiplied, in linear light: the engine’s working space, so a gradient between two colors passes through the physical mix of them, and a stop fading to transparent does not darken its neighbour.
Variants§
Solid
One color.
LinearGradient
Colors along the line from start to end, constant across it.
Fields
§
stops: Vec<GradientStop>Two to MAX_GRADIENT_STOPS stops.
RadialGradient
Colors along the radius of a circle.
Fields
§
radius: f32The distance of offset 1 from the centre, as a fraction of the picture’s shorter side. Positive.
§
stops: Vec<GradientStop>Two to MAX_GRADIENT_STOPS stops.
ConicGradient
Colors around a point: offsets 0 to 1 are one clockwise turn.
Fields
§
stops: Vec<GradientStop>Two to MAX_GRADIENT_STOPS stops.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Paint
impl<'de> Deserialize<'de> for Paint
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
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