pub enum LinearGradientCoords {
Ends {
start: Point,
end: Point,
},
Angle {
angle: Angle,
displacement: OnPlanePos,
},
Direction {
direction: RelativeDir,
displacement: OnPlanePos,
},
}
Expand description
Describes the coordinates of a colorful linear gradient.
Variants§
Ends
Defines the linear gradient by point A to point B.
Angle
Defines the linear gradient using an angle and a displacement from the center of the target figure.
Direction
Implementations§
Source§impl LinearGradientCoords
impl LinearGradientCoords
Sourcepub fn from_ends(
start: impl Into<Point>,
end: impl Into<Point>,
) -> LinearGradientCoords
pub fn from_ends( start: impl Into<Point>, end: impl Into<Point>, ) -> LinearGradientCoords
Creates a LinearGradientCoords
from its ends.
Sourcepub fn from_angle(angle: Angle) -> LinearGradientCoords
pub fn from_angle(angle: Angle) -> LinearGradientCoords
Creates a LinearGradientCoords
from its angle.
Sourcepub fn with_displacement(
&mut self,
displacement: impl Into<OnPlanePos>,
) -> LinearGradientCoords
pub fn with_displacement( &mut self, displacement: impl Into<OnPlanePos>, ) -> LinearGradientCoords
Sets the displacement if self
is defined by its angle, otherwise, this does nothing.
Trait Implementations§
Source§impl Clone for LinearGradientCoords
impl Clone for LinearGradientCoords
Source§fn clone(&self) -> LinearGradientCoords
fn clone(&self) -> LinearGradientCoords
Returns a copy of the value. Read more
1.0.0 · 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 LinearGradientCoords
impl Debug for LinearGradientCoords
Source§impl Default for LinearGradientCoords
impl Default for LinearGradientCoords
Source§fn default() -> LinearGradientCoords
fn default() -> LinearGradientCoords
Returns the “default value” for a type. Read more
Source§impl PartialEq for LinearGradientCoords
impl PartialEq for LinearGradientCoords
impl Copy for LinearGradientCoords
impl StructuralPartialEq for LinearGradientCoords
Auto Trait Implementations§
impl Freeze for LinearGradientCoords
impl RefUnwindSafe for LinearGradientCoords
impl Send for LinearGradientCoords
impl Sync for LinearGradientCoords
impl Unpin for LinearGradientCoords
impl UnwindSafe for LinearGradientCoords
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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 more