#[non_exhaustive]pub enum Gradient {
Linear {
from: Point,
to: Point,
stops: Vec<GradientStop>,
},
Radial {
center: Point,
radius: f32,
stops: Vec<GradientStop>,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl Gradient
impl Gradient
pub fn linear( from: impl Into<Point>, to: impl Into<Point>, stops: impl Into<Vec<GradientStop>>, ) -> Gradient
pub fn radial( center: impl Into<Point>, radius: f32, stops: impl Into<Vec<GradientStop>>, ) -> Gradient
pub fn stops(&self) -> &[GradientStop]
pub fn is_vertical(&self) -> bool
pub fn direction(&self) -> Vec2
pub fn color_at(&self, p: Point) -> Color
Trait Implementations§
impl StructuralPartialEq for Gradient
Auto Trait Implementations§
impl Freeze for Gradient
impl RefUnwindSafe for Gradient
impl Send for Gradient
impl Sync for Gradient
impl Unpin for Gradient
impl UnsafeUnpin for Gradient
impl UnwindSafe for Gradient
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