Struct primitives::foundation::Gradient
source · [−]pub struct Gradient {
pub kind: GradientType,
pub stops: RefCell<Vec<ColorStop>>,
}
Expand description
Represents an opaque object describing a gradient.
Fields
kind: GradientType
Kind of gradient
stops: RefCell<Vec<ColorStop>>
Color stop store
Implementations
sourceimpl Gradient
impl Gradient
sourcepub fn new(kind: GradientType) -> Self
pub fn new(kind: GradientType) -> Self
Create new gradient with type
sourcepub fn add_color_stop(&self, stop: ColorStop)
pub fn add_color_stop(&self, stop: ColorStop)
Create color stop to gradient
sourcepub fn color_count(&self) -> usize
pub fn color_count(&self) -> usize
Retrieve count of color stop’s
sourcepub fn get_color_stop(&self, index: usize) -> Option<ColorStop>
pub fn get_color_stop(&self, index: usize) -> Option<ColorStop>
Retrieve color stop by index
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Gradient
impl Send for Gradient
impl !Sync for Gradient
impl Unpin for Gradient
impl UnwindSafe for Gradient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more