pub struct LinearGradient {
pub begin: AlignmentGeometry,
pub end: AlignmentGeometry,
pub colors: Vec<Color>,
pub stops: Option<Vec<f32>>,
pub tile_mode: TileMode,
pub rotation: f32,
}Expand description
A gradient along a line, from begin to end (gradient.dart’s
LinearGradient). Unset, from the centre of the left side to the centre of the right.
Fields§
§begin: AlignmentGeometryWhere the first colour is.
end: AlignmentGeometryWhere the last colour is.
colors: Vec<Color>The colours, first to last.
stops: Option<Vec<f32>>Where each colour is, from 0 to 1, as many as there are colours; None spreads
them evenly.
tile_mode: TileModePast the ends.
rotation: f32A turn of the whole gradient about the box’s centre, in radians clockwise — the
reference’s GradientRotation.
Implementations§
Source§impl LinearGradient
impl LinearGradient
Sourcepub fn new(colors: impl Into<Vec<Color>>) -> LinearGradient
pub fn new(colors: impl Into<Vec<Color>>) -> LinearGradient
From the centre of the left side to the centre of the right, through colors.
Sourcepub fn between(
self,
begin: impl Into<AlignmentGeometry>,
end: impl Into<AlignmentGeometry>,
) -> LinearGradient
pub fn between( self, begin: impl Into<AlignmentGeometry>, end: impl Into<AlignmentGeometry>, ) -> LinearGradient
Where the first and the last colours are.
Trait Implementations§
Source§impl Clone for LinearGradient
impl Clone for LinearGradient
Source§fn clone(&self) -> LinearGradient
fn clone(&self) -> LinearGradient
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 LinearGradient
impl Debug for LinearGradient
Source§impl From<LinearGradient> for Gradient
impl From<LinearGradient> for Gradient
Source§fn from(g: LinearGradient) -> Gradient
fn from(g: LinearGradient) -> Gradient
Converts to this type from the input type.
Source§impl PartialEq for LinearGradient
impl PartialEq for LinearGradient
impl StructuralPartialEq for LinearGradient
Auto Trait Implementations§
impl Freeze for LinearGradient
impl RefUnwindSafe for LinearGradient
impl Send for LinearGradient
impl Sync for LinearGradient
impl Unpin for LinearGradient
impl UnsafeUnpin for LinearGradient
impl UnwindSafe for LinearGradient
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