pub struct Stop {
pub color: Color,
pub offset: Ratio,
}Expand description
A structure representing a color stop in a gradient with a specified color and offset.
Fields§
§color: Color§offset: RatioImplementations§
Source§impl Stop
impl Stop
Sourcepub const fn new(color: Color, offset: Ratio) -> Self
pub const fn new(color: Color, offset: Ratio) -> Self
Creates a new Stop instance with the specified color and offset.
§Arguments
color- The color of the stop in the gradient.offset- The offset of the stop, represented as a ratio.
§Examples
use typwire::{Ratio, Stop, color};
let stop = Stop::new(color::BLACK, Ratio::new(0.5));
assert_eq!(stop.color, color::BLACK);
assert_eq!(stop.offset, Ratio::new(0.5));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stop
impl<'de> Deserialize<'de> for Stop
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
Auto Trait Implementations§
impl Freeze for Stop
impl RefUnwindSafe for Stop
impl Send for Stop
impl Sync for Stop
impl Unpin for Stop
impl UnwindSafe for Stop
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)