pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
}Expand description
RGB color in linear space ([0, 1]).
Fields§
§r: f32§g: f32§b: f32Implementations§
Source§impl Color
impl Color
pub fn new(r: f32, g: f32, b: f32) -> Self
Sourcepub fn to_parts_rgb(self) -> [f32; 3]
pub fn to_parts_rgb(self) -> [f32; 3]
Splits the color into RGB ordered parts.
Sourcepub fn to_parts_bgr(self) -> [f32; 3]
pub fn to_parts_bgr(self) -> [f32; 3]
Splits the color into BGR ordered parts.
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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)