pub struct ColorStop {
pub offset: f32,
pub color: Color,
}
Expand description
Offset and color of a transition point in a gradient.
Fields§
§offset: f32
Normalized offset of the stop.
color: Color
Color at the specified offset.
Implementations§
source§impl ColorStop
impl ColorStop
sourcepub fn with_alpha_factor(self, alpha: f32) -> Self
👎Deprecated since 0.2.0: This method has been renamed to multiply_alpha
.
pub fn with_alpha_factor(self, alpha: f32) -> Self
multiply_alpha
.Returns the color stop with the alpha component multiplied by the specified factor.
sourcepub fn multiply_alpha(self, alpha: f32) -> Self
pub fn multiply_alpha(self, alpha: f32) -> Self
Returns the color stop with the alpha component multiplied by alpha
.
The behaviour of this transformation is undefined if alpha
is negative.
If any resulting alphas would overflow, these currently saturate (to opaque).
Trait Implementations§
source§impl<'de> Deserialize<'de> for ColorStop
impl<'de> Deserialize<'de> for ColorStop
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialOrd for ColorStop
impl PartialOrd for ColorStop
impl Copy for ColorStop
impl Eq for ColorStop
Auto Trait Implementations§
impl Freeze for ColorStop
impl RefUnwindSafe for ColorStop
impl Send for ColorStop
impl Sync for ColorStop
impl Unpin for ColorStop
impl UnwindSafe for ColorStop
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
)