Fields
r: f32g: f32b: f32a: f32Implementations
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 may not 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) -> Color
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more