[][src]Struct coffee::graphics::Color

pub struct Color {
    pub r: f32,
    pub g: f32,
    pub b: f32,
    pub a: f32,
}

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_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Color[src]

Auto Trait Implementations

impl Send for Color

impl Sync for Color

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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>, 

Sets value as a parameter of self.

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Any + Debug
[src]

fn is<T>() -> bool where
    T: Scalar
[src]

Tests if Self the same as the type T Read more

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,