Struct iced_graphics::gradient::Linear
source · pub struct Linear {
pub start: Point,
pub end: Point,
pub stops: [Option<ColorStop>; 8],
}
Expand description
A linear gradient.
Fields§
§start: Point
The absolute starting position of the gradient.
end: Point
The absolute ending position of the gradient.
stops: [Option<ColorStop>; 8]
ColorStop
s along the linear gradient direction.
Implementations§
source§impl Linear
impl Linear
sourcepub fn add_stop(self, offset: f32, color: Color) -> Self
pub fn add_stop(self, offset: f32, color: Color) -> Self
Adds a new ColorStop
, defined by an offset and a color, to the gradient.
Any offset
that is not within 0.0..=1.0
will be silently ignored.
Any stop added after the 8th will be silently ignored.
sourcepub fn add_stops(self, stops: impl IntoIterator<Item = ColorStop>) -> Self
pub fn add_stops(self, stops: impl IntoIterator<Item = ColorStop>) -> Self
Adds multiple ColorStop
s to the gradient.
Any stop added after the 8th will be silently ignored.
Trait Implementations§
source§impl PartialEq for Linear
impl PartialEq for Linear
impl Copy for Linear
impl StructuralPartialEq for Linear
Auto Trait Implementations§
impl RefUnwindSafe for Linear
impl Send for Linear
impl Sync for Linear
impl Unpin for Linear
impl UnwindSafe for Linear
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