pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}Expand description
Color structure, values are stored as floats (f32)
Fields§
§r: f32§g: f32§b: f32§a: f32Implementations§
Source§impl Color
impl Color
pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self
pub fn new_255(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn set(&mut self, r: f32, g: f32, b: f32, a: f32)
pub fn set_255(&mut self, r: u8, g: u8, b: u8, a: u8)
pub fn get_r(&self) -> u8
pub fn get_g(&self) -> u8
pub fn get_b(&self) -> u8
pub fn get_a(&self) -> u8
pub fn premultiply_aplha(&mut self)
pub fn lerp(&mut self, target: &Color, t: f32)
pub fn clamp(&mut self)
pub fn copy(&self) -> Self
pub fn add(&mut self, other: &Color)
pub fn subtract(&mut self, other: &Color)
pub fn multiply(&mut self, other: &Color)
pub fn divide(&mut self, other: &Color)
pub fn equals(&self, other: &Color) -> bool
pub fn clear() -> Self
pub fn black() -> Self
pub fn white() -> Self
pub fn red() -> Self
pub fn green() -> Self
pub fn blue() -> Self
pub fn cyan() -> Self
pub fn yellow() -> Self
pub fn magenta() -> Self
Trait Implementations§
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