[][src]Struct all_is_cubes::math::RGB

pub struct RGB(_);

A floating-point RGB color value.

  • Nominal range 0 to 1, but permitting out of range values.
  • NaN is banned with runtime checks so that Eq may be implemented. (Infinities are permitted.)
  • Color values are linear (gamma = 1).

Implementations

impl RGB[src]

pub const ZERO: RGB[src]

Black.

pub const ONE: RGB[src]

White (unity brightness.)

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

Constructs a color from components. Panics if any component is NaN. No other range checks are performed.

pub fn with_alpha(self, alpha: f32) -> RGBA[src]

Adds an alpha component to produce an RGBA color.

pub const fn red(self) -> f32[src]

pub const fn green(self) -> f32[src]

pub const fn blue(self) -> f32[src]

Trait Implementations

impl Add<RGB> for RGB[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<RGB> for RGB[src]

impl Clone for RGB[src]

impl Copy for RGB[src]

impl Debug for RGB[src]

impl Div<f32> for RGB[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, scalar: f32) -> Self[src]

Divides this color value by a scalar. Panics if the scalar is zero.

impl Eq for RGB[src]

impl From<PackedLight> for RGB[src]

impl From<RGB> for PackedLight[src]

impl From<RGB> for Vector3<f32>[src]

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

impl From<Rgb888> for RGB[src]

Adapt embedded_graphics's color type to ours.

impl Hash for RGB[src]

impl Mul<RGB> for RGB[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: RGB) -> Self[src]

Multiplies this color value componentwise.

impl Mul<f32> for RGB[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, scalar: f32) -> Self[src]

Multiplies this color value by a scalar. Panics if the scalar is NaN.

impl PartialEq<RGB> for RGB[src]

impl StructuralPartialEq for RGB[src]

impl TryFrom<Vector3<f32>> for RGB[src]

type Error = ColorIsNan

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for RGB

impl Send for RGB

impl Sync for RGB

impl Unpin for RGB

impl UnwindSafe for RGB

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> Erased for T[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,