#[repr(packed(1))]pub struct Color {
pub data: u32,
}
Expand description
A r g b a color.
Fields§
§data: u32
Implementations§
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§
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.
Source§impl PartialOrd for Color
impl PartialOrd for Color
impl Copy 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 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