[−][src]Struct all_is_cubes::math::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.
fn add(self, other: Self) -> Self
[src]
impl AddAssign<RGB> for RGB
[src]
fn add_assign(&mut self, other: Self)
[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]
fn from(value: PackedLight) -> Self
[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]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
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]
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,
fn borrow_mut(&mut self) -> &mut T
[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]
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, 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.
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>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,