[−][src]Struct coffee::graphics::Color
An RGBA color in the sRGB color space.
Fields
r: f32
Red component.
g: f32
Green component.
b: f32
Blue component.
a: f32
Alpha component.
Methods
impl Color
[src]
pub const WHITE: Self
[src]
White color.
pub const BLACK: Self
[src]
Black color.
pub fn new(r: f32, g: f32, b: f32, a: f32) -> Color
[src]
Create a new color from components in the [0, 1.0] range.
pub fn from_rgb(r: u8, g: u8, b: u8) -> Color
[src]
Create a new color from its RGB components in the [0, 255] range.
pub fn to_rgba(&self) -> [u8; 4]
[src]
Get the color components in the [0, 255] range.
Trait Implementations
impl Copy for Color
[src]
impl PartialEq<Color> for Color
[src]
impl From<[u8; 3]> for Color
[src]
impl From<Color> for [f32; 4]
[src]
impl From<Color> for [u8; 4]
[src]
impl Clone for Color
[src]
fn clone(&self) -> Color
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Color
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Erased for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> Scalar for T where
T: Copy + PartialEq<T> + Any + Debug,
[src]
T: Copy + PartialEq<T> + Any + Debug,
impl<T> Same for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,