#[repr(packed(1))]pub struct Color {
pub data: u32,
}Expand description
A r g b a color.
Fields§
§data: u32Implementations§
Source§impl Color
impl Color
Sourcepub fn hsv(h: f64, s: f64, v: f64) -> Color
pub fn hsv(h: f64, s: f64, v: f64) -> Color
Create a new color from HSV(0.0-360.0, 0.0-1.0, 0.0-1.0)
Sourcepub fn hsl(h: f64, s: f64, l: f64) -> Color
pub fn hsl(h: f64, s: f64, l: f64) -> Color
Create a new color from HSL(0.0-360.0, 0.0-1.0, 0.0-1.0)
Sourcepub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Color
pub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Color
Create a new color from RGB and alpha values
Sourcepub fn hsva(hue: f64, saturation: f64, value: f64, alpha: f64) -> Color
pub fn hsva(hue: f64, saturation: f64, value: f64, alpha: f64) -> Color
Create a new color from HSV(0.0-360.0, 0.0-1.0, 0.0-1.0) and alpha values(0.0-1.0)
Sourcepub fn hsla(hue: f64, saturation: f64, lightness: f64, alpha: f64) -> Color
pub fn hsla(hue: f64, saturation: f64, lightness: f64, alpha: f64) -> Color
Create a new color from HSL(0.0-360.0, 0.0-1.0, 0.0-1.0) and alpha values(0.0-1.0)
Trait Implementations§
impl Copy for Color
Source§impl From<Color> for GradientStop
impl From<Color> for GradientStop
Source§fn from(color: Color) -> GradientStop
fn from(color: Color) -> GradientStop
Converts to this type from the input type.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more