[−][src]Struct duku::Rgbf
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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> 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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,