pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}Fields§
§r: f32§g: f32§b: f32§a: f32Implementations§
Source§impl Color
impl Color
pub const TRANSPARENT: Color
pub const BLACK: Color
pub const WHITE: Color
pub const RED: Color
pub const GREEN: Color
pub const BLUE: Color
pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Self
pub const fn rgb(hex: u32) -> Self
pub const fn from_rgba8(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn hsl(h: f32, s: f32, l: f32) -> Self
pub const fn with_alpha(self, a: f32) -> Self
pub fn over(self, background: Color) -> Color
pub fn premultiplied(self) -> [f32; 4]
pub fn to_array(self) -> [f32; 4]
pub fn to_rgba8(self) -> [u8; 4]
Trait Implementations§
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Forget for Color
impl Freeze for Color
impl Move 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