pub struct Gradient { /* private fields */ }Expand description
A multi-stop gradient for table effects.
Implementations§
Source§impl Gradient
impl Gradient
Sourcepub fn new(stops: Vec<(f32, PackedRgba)>) -> Self
pub fn new(stops: Vec<(f32, PackedRgba)>) -> Self
Create a new gradient with stops in the range [0, 1].
Sourcepub fn stops(&self) -> &[(f32, PackedRgba)]
pub fn stops(&self) -> &[(f32, PackedRgba)]
Access the gradient stops (sorted by position).
Sourcepub fn sample(&self, t: f32) -> PackedRgba
pub fn sample(&self, t: f32) -> PackedRgba
Sample the gradient at a normalized position in [0, 1].
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