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§
Source§impl 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 !Freeze for Gradient
impl !RefUnwindSafe for Gradient
impl Send for Gradient
impl !Sync for Gradient
impl Unpin 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,
Source§impl<Fr, To> IntoColor<To> for Frwhere
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Frwhere
To: FromColor<Fr>,
Source§fn into_color(self) -> To
fn into_color(self) -> To
Convert into color