pub struct GradientLiteral {
pub kind: GradientKind,
pub angle_deg: f64,
pub center_x: Option<f64>,
pub center_y: Option<f64>,
pub radius: Option<f64>,
pub stops: Vec<GradientStopRef>,
}Expand description
A gradient token literal: either linear (angle + stops) or radial (center + radius + stops).
Fields§
§kind: GradientKindWhether the gradient is linear or radial.
angle_deg: f64Angle in degrees, clockwise from +x (0 = left→right, 90 = top→bottom).
Relevant only for kind == Linear; ignored for radial.
center_x: Option<f64>Radial gradient center X as a fraction of the bounding-box width (0..1).
None defaults to 0.5 (center). Ignored for linear.
center_y: Option<f64>Radial gradient center Y as a fraction of the bounding-box height (0..1).
None defaults to 0.5 (center). Ignored for linear.
radius: Option<f64>Radial gradient radius as a fraction of the box diagonal (hypot(w,h)/2).
None defaults to 1.0. Must be > 0 if specified.
stops: Vec<GradientStopRef>Ordered list of stop references, in source order.
Trait Implementations§
Source§impl Clone for GradientLiteral
impl Clone for GradientLiteral
Source§fn clone(&self) -> GradientLiteral
fn clone(&self) -> GradientLiteral
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GradientLiteral
impl Debug for GradientLiteral
Source§impl PartialEq for GradientLiteral
impl PartialEq for GradientLiteral
Source§fn eq(&self, other: &GradientLiteral) -> bool
fn eq(&self, other: &GradientLiteral) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GradientLiteral
Auto Trait Implementations§
impl Freeze for GradientLiteral
impl RefUnwindSafe for GradientLiteral
impl Send for GradientLiteral
impl Sync for GradientLiteral
impl Unpin for GradientLiteral
impl UnsafeUnpin for GradientLiteral
impl UnwindSafe for GradientLiteral
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