pub enum OverlayFill {
Solid([f32; 4]),
LinearGradient {
start_colour: [f32; 4],
end_colour: [f32; 4],
angle: f32,
},
RadialGradient {
centre_colour: [f32; 4],
edge_colour: [f32; 4],
},
ConicalGradient {
start_colour: [f32; 4],
end_colour: [f32; 4],
offset_angle: f32,
},
LinearGradientMulti {
stops: Vec<GradientStop>,
angle: f32,
},
RadialGradientMulti {
stops: Vec<GradientStop>,
},
ConicalGradientMulti {
stops: Vec<GradientStop>,
offset_angle: f32,
},
}Expand description
Fill style for an [OverlayShapeItem].
Solid is the default and matches the previous single-colour behaviour.
LinearGradient, RadialGradient, and ConicalGradient interpolate
between two colours across the shape’s bounding box.
Variants§
Solid([f32; 4])
Uniform solid colour in linear RGBA float format.
LinearGradient
Linear gradient between two colours.
The gradient runs along angle across the bounding box. angle = 0.0
goes left-to-right (start_colour on the left, end_colour on the
right). Positive angles rotate the direction counter-clockwise in math
coordinates; because screen Y points downward, angle = PI/2 produces
a top-to-bottom gradient (start at top, end at bottom).
Fields
RadialGradient
Radial gradient running from the shape centre to its bounding-box edge.
centre_colour sits at the shape origin; edge_colour sits at the
farthest bounding-box corner. The transition follows
length(local_pos) / max_half_size.
Fields
ConicalGradient
Conical (sweep) gradient rotating around the shape centre.
The hue wraps once around the origin like a colour wheel.
offset_angle rotates the seam (where end_colour meets
start_colour) counter-clockwise in math coordinates.
Fields
LinearGradientMulti
Linear gradient with three or more colour stops at arbitrary
positions along the gradient axis. Use when a two-stop ramp is too
flat; designers commonly stack 3-5 stops for polished surfaces.
Stops outside [0, 1] are clamped; more than
OVERLAY_MAX_GRADIENT_STOPS entries are truncated.
Fields
stops: Vec<GradientStop>Stops in source order. Need not be pre-sorted by position; the renderer sorts them at prepare time.
RadialGradientMulti
Radial gradient with three or more colour stops between the shape centre and its bounding-box edge.
Fields
stops: Vec<GradientStop>Stops along the centre-to-edge axis.
ConicalGradientMulti
Conical gradient with three or more colour stops along the sweep.
Fields
stops: Vec<GradientStop>Stops along the [0, 1] sweep parameter.
Trait Implementations§
Source§impl Clone for OverlayFill
impl Clone for OverlayFill
Source§fn clone(&self) -> OverlayFill
fn clone(&self) -> OverlayFill
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverlayFill
impl Debug for OverlayFill
Source§impl Default for OverlayFill
impl Default for OverlayFill
Source§impl PartialEq for OverlayFill
impl PartialEq for OverlayFill
Source§fn eq(&self, other: &OverlayFill) -> bool
fn eq(&self, other: &OverlayFill) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OverlayFill
Auto Trait Implementations§
impl Freeze for OverlayFill
impl RefUnwindSafe for OverlayFill
impl Send for OverlayFill
impl Sync for OverlayFill
impl Unpin for OverlayFill
impl UnsafeUnpin for OverlayFill
impl UnwindSafe for OverlayFill
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.