Struct nannou::color::RgbHue [−][src]
A hue type for the RGB family of color spaces.
It’s measured in degrees and uses the three additive primaries red, green and blue.
The hue is a circular type, where 0
and 360
is the same, and
it’s normalized to (-180, 180]
when it’s converted to a linear
number (like f32
). This makes many calculations easier, but may
also have some surprising effects if it’s expected to act as a
linear number.
Implementations
impl<T> RgbHue<T> where
T: Float,
[src]
T: Float,
pub fn from_degrees(degrees: T) -> RgbHue<T>
[src]
Create a new hue from degrees.
pub fn from_radians(radians: T) -> RgbHue<T>
[src]
Create a new hue from radians, instead of degrees.
pub fn to_degrees(self) -> T
[src]
Get the hue as degrees, in the range (-180, 180]
.
pub fn to_radians(self) -> T
[src]
Convert the hue to radians, in the range (-π, π]
.
pub fn to_positive_degrees(self) -> T
[src]
Convert the hue to positive degrees, in the range [0, 360)
.
pub fn to_positive_radians(self) -> T
[src]
Convert the hue to positive radians, in the range [0, 2π)
.
pub fn to_raw_degrees(self) -> T
[src]
Get the internal representation, without normalizing it.
pub fn to_raw_radians(self) -> T
[src]
Get the internal representation as radians, without normalizing it.
Trait Implementations
impl<T> AbsDiffEq<RgbHue<T>> for RgbHue<T> where
T: Float + AbsDiffEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Float,
[src]
T: Float + AbsDiffEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Float,
type Epsilon = <T as AbsDiffEq<T>>::Epsilon
Used for specifying relative comparisons.
pub fn default_epsilon() -> <RgbHue<T> as AbsDiffEq<RgbHue<T>>>::Epsilon
[src]
pub fn abs_diff_eq(
&self,
other: &RgbHue<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon
) -> bool
[src]
&self,
other: &RgbHue<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon
) -> bool
pub fn abs_diff_ne(
&self,
other: &RgbHue<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon
) -> bool
[src]
&self,
other: &RgbHue<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon
) -> bool
impl<T> Add<RgbHue<T>> for RgbHue<T> where
T: Float,
[src]
T: Float,
type Output = RgbHue<T>
The resulting type after applying the +
operator.
pub fn add(self, other: RgbHue<T>) -> RgbHue<T>
[src]
impl<T> Add<T> for RgbHue<T> where
T: Float,
[src]
T: Float,
type Output = RgbHue<T>
The resulting type after applying the +
operator.
pub fn add(self, other: T) -> RgbHue<T>
[src]
impl<T> AddAssign<RgbHue<T>> for RgbHue<T> where
T: Float + AddAssign<T>,
[src]
T: Float + AddAssign<T>,
pub fn add_assign(&mut self, other: RgbHue<T>)
[src]
impl<T> AddAssign<T> for RgbHue<T> where
T: Float + AddAssign<T>,
[src]
T: Float + AddAssign<T>,
pub fn add_assign(&mut self, other: T)
[src]
impl<T> Clone for RgbHue<T> where
T: Clone + Float,
[src]
T: Clone + Float,
impl<T> Copy for RgbHue<T> where
T: Copy + Float,
[src]
T: Copy + Float,
impl<T> Debug for RgbHue<T> where
T: Debug + Float,
[src]
T: Debug + Float,
impl<T> Default for RgbHue<T> where
T: Default + Float,
[src]
T: Default + Float,
impl<T> From<T> for RgbHue<T> where
T: Float,
[src]
T: Float,
impl Into<f32> for RgbHue<f64>
[src]
impl Into<f32> for RgbHue<f32>
[src]
impl Into<f64> for RgbHue<f64>
[src]
impl<T> PartialEq<RgbHue<T>> for RgbHue<T> where
T: Float,
[src]
T: Float,
pub fn eq(&self, other: &RgbHue<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> PartialEq<T> for RgbHue<T> where
T: Float,
[src]
T: Float,
impl<T> RelativeEq<RgbHue<T>> for RgbHue<T> where
T: Float + RelativeEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Float,
[src]
T: Float + RelativeEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Float,
pub fn default_max_relative() -> <RgbHue<T> as AbsDiffEq<RgbHue<T>>>::Epsilon
[src]
pub fn relative_eq(
&self,
other: &RgbHue<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon,
max_relative: <T as AbsDiffEq<T>>::Epsilon
) -> bool
[src]
&self,
other: &RgbHue<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon,
max_relative: <T as AbsDiffEq<T>>::Epsilon
) -> bool
pub fn relative_ne(
&self,
other: &RgbHue<T>,
epsilon: <RgbHue<T> as AbsDiffEq<RgbHue<T>>>::Epsilon,
max_relative: <RgbHue<T> as AbsDiffEq<RgbHue<T>>>::Epsilon
) -> bool
[src]
&self,
other: &RgbHue<T>,
epsilon: <RgbHue<T> as AbsDiffEq<RgbHue<T>>>::Epsilon,
max_relative: <RgbHue<T> as AbsDiffEq<RgbHue<T>>>::Epsilon
) -> bool
impl<T> Sub<RgbHue<T>> for RgbHue<T> where
T: Float,
[src]
T: Float,
type Output = RgbHue<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: RgbHue<T>) -> RgbHue<T>
[src]
impl<T> Sub<T> for RgbHue<T> where
T: Float,
[src]
T: Float,
type Output = RgbHue<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: T) -> RgbHue<T>
[src]
impl<T> SubAssign<RgbHue<T>> for RgbHue<T> where
T: Float + SubAssign<T>,
[src]
T: Float + SubAssign<T>,
pub fn sub_assign(&mut self, other: RgbHue<T>)
[src]
impl<T> SubAssign<T> for RgbHue<T> where
T: Float + SubAssign<T>,
[src]
T: Float + SubAssign<T>,
pub fn sub_assign(&mut self, other: T)
[src]
impl<T> UlpsEq<RgbHue<T>> for RgbHue<T> where
T: Float + UlpsEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Float,
[src]
T: Float + UlpsEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Float,
Auto Trait Implementations
impl<T> RefUnwindSafe for RgbHue<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for RgbHue<T> where
T: Send,
T: Send,
impl<T> Sync for RgbHue<T> where
T: Sync,
T: Sync,
impl<T> Unpin for RgbHue<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for RgbHue<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
[src]
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
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, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> Downcast<T> for T
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> SetParameter for T
pub fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Upcast<T> for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,