pub struct Gradient {
pub shape: GradientShape,
pub space: Interpolation,
/* private fields */
}Fields§
§shape: GradientShape§space: InterpolationImplementations§
Source§impl Gradient
impl Gradient
pub fn new( shape: GradientShape, stops: &[(f32, [f32; 4])], ) -> Result<Self, String>
pub fn linear( from: [f32; 2], to: [f32; 2], stops: &[(f32, [f32; 4])], ) -> Result<Self, String>
pub fn radial( centre: [f32; 2], radius: [f32; 2], stops: &[(f32, [f32; 4])], ) -> Result<Self, String>
pub fn space(self, space: Interpolation) -> Self
pub fn stops(&self) -> impl Iterator<Item = (f32, [f32; 4])> + '_
pub fn max_alpha(&self) -> f32
pub fn geometry(&self) -> [f32; 4]
pub fn header(&self) -> [f32; 4]
pub fn packed(&self) -> [[f32; 4]; 12]
pub fn position(&self, p: [f32; 2]) -> f32
pub fn colour(&self, t: f32) -> [f32; 4]
pub fn paint(&self, p: [f32; 2]) -> [f32; 4]
Trait Implementations§
impl Copy for Gradient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.