Struct components::foundation::Gradient
[−]pub struct Gradient {
pub kind: GradientType,
pub stops: RefCell<Vec<ColorStop, Global>>,
}
Expand description
Represents an opaque object describing a gradient.
Fields
kind: GradientType
Kind of gradient
stops: RefCell<Vec<ColorStop, Global>>
Color stop store
Implementations
impl Gradient
impl Gradient
pub fn new(kind: GradientType) -> Gradient
pub fn new(kind: GradientType) -> Gradient
Create new gradient with type
pub fn add_color_stop(&self, stop: ColorStop)
pub fn add_color_stop(&self, stop: ColorStop)
Create color stop to gradient
pub fn color_count(&self) -> usize
pub fn color_count(&self) -> usize
Retrieve count of color stop’s
pub 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
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.