pub struct Gradient {
pub geometry: Geometry,
pub stops: Arc<[(f64, Color)]>,
pub space: GradientSpace,
pub units: GradientUnits,
pub extend: GradientExtend,
}Expand description
Shared gradient description retained by paint and validated before preparation.
Fields§
§geometry: GeometryFinite, nondegenerate shape of the gradient coordinate field.
stops: Arc<[(f64, Color)]>Two to 64 ordered stops including positions zero and one; equal positions make hard stops.
space: GradientSpaceStraight-color interpolation space; sampled output is linear premultiplied RGBA.
units: GradientUnitsWhether geometry uses local logical units or normalized shape bounds.
extend: GradientExtendCoordinate policy before interpolation between the stop colors.
Implementations§
Source§impl Gradient
impl Gradient
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Checks ordered endpoint-inclusive stops and finite, nondegenerate geometry.
Trait Implementations§
impl StructuralPartialEq for Gradient
Auto Trait Implementations§
impl Forget for Gradient
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