pub struct ResolvedGradient {
pub kind: GradientKind,
pub angle_deg: f64,
pub center_x: Option<f64>,
pub center_y: Option<f64>,
pub radius: Option<f64>,
pub stops: Vec<(f64, String)>,
}Expand description
A resolved gradient: either linear (angle + stops) or radial
(center + radius + stops). Offsets are clamped into 0.0..=1.0.
Stop-color existence and type are checked in a second pass over the
fully-resolved token map.
Fields§
§kind: GradientKindWhether this is a linear or radial gradient.
angle_deg: f64Angle in degrees, clockwise from +x. Relevant only for kind == Linear.
center_x: Option<f64>Radial center X fraction of bounding-box width. None → 0.5.
center_y: Option<f64>Radial center Y fraction of bounding-box height. None → 0.5.
radius: Option<f64>Radial radius fraction of box diagonal (hypot(w,h)/2). None → 1.0.
stops: Vec<(f64, String)>Ordered (offset, color_token_id) stops.
Trait Implementations§
Source§impl Clone for ResolvedGradient
impl Clone for ResolvedGradient
Source§fn clone(&self) -> ResolvedGradient
fn clone(&self) -> ResolvedGradient
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 ResolvedGradient
impl Debug for ResolvedGradient
Source§impl PartialEq for ResolvedGradient
impl PartialEq for ResolvedGradient
Source§fn eq(&self, other: &ResolvedGradient) -> bool
fn eq(&self, other: &ResolvedGradient) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResolvedGradient
Auto Trait Implementations§
impl Freeze for ResolvedGradient
impl RefUnwindSafe for ResolvedGradient
impl Send for ResolvedGradient
impl Sync for ResolvedGradient
impl Unpin for ResolvedGradient
impl UnsafeUnpin for ResolvedGradient
impl UnwindSafe for ResolvedGradient
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