pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}Expand description
An sRGB color with straight alpha, each channel in 0.0..=1.0.
Fields§
§r: f32§g: f32§b: f32§a: f32Implementations§
Source§impl Color
impl Color
Sourcepub fn blend(self, to: Self, t: f32) -> Self
pub fn blend(self, to: Self, t: f32) -> Self
Linear interpolation toward to; t is clamped to 0.0..=1.0, and the ends are exact.
State layers, tonal containers and palette transitions all use this one blend, so a hovered selected control resolves over its current container instead of stacking translucent fills.
Trait Implementations§
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
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