Fields
r: f32
g: f32
b: f32
a: f32
Implementations
sourceimpl Color
impl Color
pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Color
sourcepub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Color
pub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Color
Build a color from 4 0..255 components Unfortunately it can’t be const fn due to https://github.com/rust-lang/rust/issues/57241 When const version is needed “color_u8” macro may be a workaround
pub fn to_vec(&self) -> Vec4
pub fn from_vec(vec: Vec4) -> Self
Trait Implementations
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more