[][src]Struct duku::Rgbf

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

Color floats in RGB with alpha.

Makes it easier to handle/convert colors.

Examples

let red = Rgbf::red(0.7);

Fields

r: f32

the red component

g: f32

the green component

b: f32

the blue component

a: f32

the alpha component

Implementations

impl Rgbf[src]

pub const fn new(r: f32, g: f32, b: f32) -> Self[src]

Create color

pub const fn gray(v: f32) -> Self[src]

Create color with the same value for all components

pub const fn red(v: f32) -> Self[src]

Create color with setting only the red component

pub const fn green(v: f32) -> Self[src]

Create color with setting only the green component

pub const fn blue(v: f32) -> Self[src]

Create color with setting only the blue component

pub const fn clear() -> Self[src]

Create transparent color

pub const fn alpha(self, a: f32) -> Self[src]

Create color, modifying the color's alpha

Examples

let color = Rgbf::blue(0.5).alpha(0.3);

Trait Implementations

impl Clone for Rgbf[src]

impl Copy for Rgbf[src]

impl Debug for Rgbf[src]

impl Default for Rgbf[src]

impl<'_> From<&'_ str> for Rgbf[src]

impl From<[f32; 3]> for Rgbf[src]

impl From<[f32; 4]> for Rgbf[src]

impl From<Hsb> for Rgbf[src]

impl From<Rgb> for Rgbf[src]

impl From<Rgbf> for Hsb[src]

impl From<Rgbf> for Rgb[src]

impl From<Rgbf> for Vec3[src]

impl From<Rgbf> for Vec4[src]

impl Into<[f32; 4]> for Rgbf[src]

impl Mix for Rgbf[src]

impl PartialEq<Rgbf> for Rgbf[src]

impl StructuralPartialEq for Rgbf[src]

Auto Trait Implementations

impl RefUnwindSafe for Rgbf

impl Send for Rgbf

impl Sync for Rgbf

impl Unpin for Rgbf

impl UnwindSafe for Rgbf

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> 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, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.