pub struct RadialGradient { /* private fields */ }Expand description
A 2-point conical gradient shader.
Implementations§
Source§impl RadialGradient
impl RadialGradient
Sourcepub fn new(
start_point: Point,
start_radius: f32,
end_point: Point,
end_radius: f32,
stops: Vec<GradientStop>,
mode: SpreadMode,
transform: Transform,
) -> Option<Shader<'static>>
pub fn new( start_point: Point, start_radius: f32, end_point: Point, end_radius: f32, stops: Vec<GradientStop>, mode: SpreadMode, transform: Transform, ) -> Option<Shader<'static>>
Creates a new two-point conical gradient shader.
A two-point conical gradient (also known as a radial gradient) interpolates colors between two circles defined by their center points and radii.
Returns Shader::SolidColor when:
stops.len()== 1
Returns None when:
stopsis emptystart_radius< 0 orend_radius< 0transformis not invertible- The gradient is degenerate (both radii and centers are equal, except in specific pad mode cases)
Trait Implementations§
Source§impl Clone for RadialGradient
impl Clone for RadialGradient
Source§fn clone(&self) -> RadialGradient
fn clone(&self) -> RadialGradient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RadialGradient
impl Debug for RadialGradient
Source§impl PartialEq for RadialGradient
impl PartialEq for RadialGradient
impl StructuralPartialEq for RadialGradient
Auto Trait Implementations§
impl Freeze for RadialGradient
impl RefUnwindSafe for RadialGradient
impl Send for RadialGradient
impl Sync for RadialGradient
impl Unpin for RadialGradient
impl UnwindSafe for RadialGradient
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