Enum orbtk_utils::LinearGradientCoords
source · [−]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
sourceimpl 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
sourceimpl Clone for LinearGradientCoords
impl Clone for LinearGradientCoords
sourcefn clone(&self) -> LinearGradientCoords
fn clone(&self) -> LinearGradientCoords
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LinearGradientCoords
impl Debug for LinearGradientCoords
sourceimpl Default for LinearGradientCoords
impl Default for LinearGradientCoords
sourcefn default() -> LinearGradientCoords
fn default() -> LinearGradientCoords
Returns the “default value” for a type. Read more
sourceimpl PartialEq<LinearGradientCoords> for LinearGradientCoords
impl PartialEq<LinearGradientCoords> for LinearGradientCoords
sourcefn eq(&self, other: &LinearGradientCoords) -> bool
fn eq(&self, other: &LinearGradientCoords) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LinearGradientCoords) -> bool
fn ne(&self, other: &LinearGradientCoords) -> bool
This method tests for !=
.
impl Copy for LinearGradientCoords
impl StructuralPartialEq for LinearGradientCoords
Auto Trait Implementations
impl RefUnwindSafe for LinearGradientCoords
impl Send for LinearGradientCoords
impl Sync for LinearGradientCoords
impl Unpin for LinearGradientCoords
impl UnwindSafe for LinearGradientCoords
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more