#[repr(C)]pub struct Hwb<S = Srgb, T = f32>{
pub hue: RgbHue<T>,
pub whiteness: T,
pub blackness: T,
pub space: PhantomData<S>,
}
Expand description
Linear HWB color space.
HWB is a cylindrical version of RGB and it’s very closely related to HSV. It describes colors with a starting hue, then a degree of whiteness and blackness to mix into that base hue.
It is very intuitive for humans to use and many color-pickers are based on the HWB color system
Fields§
§hue: RgbHue<T>
The hue of the color, in degrees. Decides if it’s red, blue, purple, etc. Same as the hue for HSL and HSV.
whiteness: T
The whiteness of the color. It specifies the amount white to mix into the hue. It varies from 0 to 1, with 1 being always full white and 0 always being the color shade (a mixture of a pure hue with black) chosen with the other two controls.
blackness: T
The blackness of the color. It specifies the amount black to mix into the hue. It varies from 0 to 1, with 1 being always full black and 0 always being the color tint (a mixture of a pure hue with white) chosen with the other two
space: PhantomData<S>
The white point and RGB primaries this color is adapted to. The default is the sRGB standard.
Implementations§
Trait Implementations§
Source§impl<S, T> AbsDiffEq for Hwb<S, T>
impl<S, T> AbsDiffEq for Hwb<S, T>
Source§fn default_epsilon() -> <Hwb<S, T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Hwb<S, T> as AbsDiffEq>::Epsilon
Source§impl<S, T> AddAssign<T> for Hwb<S, T>
impl<S, T> AddAssign<T> for Hwb<S, T>
Source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
+=
operation. Read moreSource§impl<S, T> AddAssign for Hwb<S, T>
impl<S, T> AddAssign for Hwb<S, T>
Source§fn add_assign(&mut self, other: Hwb<S, T>)
fn add_assign(&mut self, other: Hwb<S, T>)
+=
operation. Read moreSource§impl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Hwb<S, T>where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
impl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Hwb<S, T>where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
Source§impl<S, T, _S> From<Hwb<_S, T>> for Alpha<Luma<S, T>, T>where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
impl<S, T, _S> From<Hwb<_S, T>> for Alpha<Luma<S, T>, T>where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
Source§impl<S, T, _S> From<Hwb<_S, T>> for Luma<S, T>where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
impl<S, T, _S> From<Hwb<_S, T>> for Luma<S, T>where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
Source§impl<S, T, _S> From<Luma<_S, T>> for Hwb<S, T>where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
impl<S, T, _S> From<Luma<_S, T>> for Hwb<S, T>where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
Source§impl<S, T> FromColor<<S as RgbSpace>::WhitePoint, T> for Hwb<S, T>
impl<S, T> FromColor<<S as RgbSpace>::WhitePoint, T> for Hwb<S, T>
Source§fn from_xyz(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hwb<S, T>
fn from_xyz(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hwb<S, T>
Source§fn from_rgb<S>(inp: Rgb<Linear<S>, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
fn from_rgb<S>(inp: Rgb<Linear<S>, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
Source§impl<S, Wp, T> IntoColor<Wp, T> for Hwb<S, T>
impl<S, Wp, T> IntoColor<Wp, T> for Hwb<S, T>
Source§fn into_rgb<Sp>(self) -> Rgb<Linear<Sp>, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_rgb<Sp>(self) -> Rgb<Linear<Sp>, T>where
Sp: RgbSpace<WhitePoint = Wp>,
Source§fn into_hsl<Sp>(self) -> Hsl<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_hsl<Sp>(self) -> Hsl<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
Source§impl<S, T> Limited for Hwb<S, T>
impl<S, T> Limited for Hwb<S, T>
Source§impl<S, T> Pixel<T> for Hwb<S, T>
impl<S, T> Pixel<T> for Hwb<S, T>
Source§fn as_raw_mut<P>(&mut self) -> &mut P
fn as_raw_mut<P>(&mut self) -> &mut P
Source§fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
Source§fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
Source§fn from_raw_slice(slice: &[T]) -> &[Self]
fn from_raw_slice(slice: &[T]) -> &[Self]
Source§fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
Source§fn into_raw_slice(slice: &[Self]) -> &[T]
fn into_raw_slice(slice: &[Self]) -> &[T]
Source§fn into_raw_slice_mut(slice: &mut [Self]) -> &mut [T]
fn into_raw_slice_mut(slice: &mut [Self]) -> &mut [T]
Source§impl<S, T> RelativeEq for Hwb<S, T>
impl<S, T> RelativeEq for Hwb<S, T>
Source§fn default_max_relative() -> <Hwb<S, T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Hwb<S, T> as AbsDiffEq>::Epsilon
Source§impl<S, T> SubAssign<T> for Hwb<S, T>
impl<S, T> SubAssign<T> for Hwb<S, T>
Source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
-=
operation. Read moreSource§impl<S, T> SubAssign for Hwb<S, T>
impl<S, T> SubAssign for Hwb<S, T>
Source§fn sub_assign(&mut self, other: Hwb<S, T>)
fn sub_assign(&mut self, other: Hwb<S, T>)
-=
operation. Read moreSource§impl<S, T> UlpsEq for Hwb<S, T>
impl<S, T> UlpsEq for Hwb<S, T>
Source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
impl<S, T> Copy for Hwb<S, T>
impl<S, T> StructuralPartialEq for Hwb<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for Hwb<S, T>where
T: Freeze,
impl<S, T> RefUnwindSafe for Hwb<S, T>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, T> Send for Hwb<S, T>
impl<S, T> Sync for Hwb<S, T>
impl<S, T> Unpin for Hwb<S, T>
impl<S, T> UnwindSafe for Hwb<S, T>where
T: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
Source§fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_from(color: S) -> Self
fn adapt_from(color: S) -> Self
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Content for Twhere
T: Copy,
impl<T> Content for Twhere
T: Copy,
Source§fn read<F, E>(size: usize, f: F) -> Result<T, E>
fn read<F, E>(size: usize, f: F) -> Result<T, E>
Owned
.Source§fn get_elements_size() -> usize
fn get_elements_size() -> usize
Source§fn to_void_ptr(&self) -> *const ()
fn to_void_ptr(&self) -> *const ()
Source§fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>
fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>
Source§fn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Source§impl<T, U> ConvertFrom<T> for U
impl<T, U> ConvertFrom<T> for U
Source§fn convert_from(t: T) -> U
fn convert_from(t: T) -> U
Source§fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>
fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read moreSource§fn convert_unclamped_from(val: T) -> Self
fn convert_unclamped_from(val: T) -> Self
Source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
Source§fn convert_into(self) -> U
fn convert_into(self) -> U
Source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more