#[repr(packed(1))]pub struct Color {
pub data: u32,
}Fields§
§data: u32Implementations§
Source§impl Color
impl Color
pub const fn rgb(r: u8, g: u8, b: u8) -> Color
pub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Color
Sourcepub fn hsl(h: f32, s: f32, l: f32) -> Color
pub fn hsl(h: f32, s: f32, l: f32) -> Color
Returns color value specified by hue, saturation and lightness. HSL values are all in range [0..1], alpha will be set to 1.0.
Sourcepub fn hsla(h: f32, s: f32, l: f32, a: f32) -> Color
pub fn hsla(h: f32, s: f32, l: f32, a: f32) -> Color
Returns color value specified by hue, saturation, lightness and alpha. All values are in range [0..1]
pub fn r(self) -> u8
pub fn g(self) -> u8
pub fn b(self) -> u8
pub fn a(self) -> u8
pub fn interpolate(start_color: Color, end_color: Color, scale: f64) -> Color
Trait Implementations§
Source§impl Interpolator for Color
impl Interpolator 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