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>) -> Self
pub fn with_displacement(&mut self, displacement: impl Into<OnPlanePos>) -> Self
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