pub struct Hwb {
pub hue: f32,
pub whiteness: f32,
pub blackness: f32,
pub alpha: f32,
}Expand description
An colour represented as Hue, Whiteness, and Blackness expressed in the sRGB colour space. The components are:
- Hue - a number between 0.0 and 360.0
- Whiteness - a number between 0.0 and 100.0
- Blackness - a number between 0.0 and 100.0
- Alpha - a number between 0.0 and 100.0
Fields§
§hue: f32§whiteness: f32§blackness: f32§alpha: f32Implementations§
Trait Implementations§
Source§impl<T, U> ColorMixPolar<T, U> for Hwb
impl<T, U> ColorMixPolar<T, U> for Hwb
fn mix_polar( first: T, second: U, percentage: f64, hue_interpolation: HueInterpolation, ) -> Self
Source§impl From<Hwb> for ProphotoRgb
impl From<Hwb> for ProphotoRgb
Source§impl From<ProphotoRgb> for Hwb
impl From<ProphotoRgb> for Hwb
Source§fn from(value: ProphotoRgb) -> Self
fn from(value: ProphotoRgb) -> Self
Converts to this type from the input type.
Source§impl Gamut for Hwb
impl Gamut for Hwb
Source§fn in_gamut(&self) -> bool
fn in_gamut(&self) -> bool
Returns
true if all colour channels are within the natural bounds of this colour space.
Alpha is not considered — it is always clamped on construction.Source§fn clamp_to_gamut(&self) -> Self
fn clamp_to_gamut(&self) -> Self
Returns a copy with all colour channels naively clamped to the natural bounds. Read more
Source§fn map_to_gamut(self) -> Self
fn map_to_gamut(self) -> Self
Perceptually maps this colour into gamut. Read more
impl Copy for Hwb
impl StructuralPartialEq for Hwb
Auto Trait Implementations§
impl Freeze for Hwb
impl RefUnwindSafe for Hwb
impl Send for Hwb
impl Sync for Hwb
impl Unpin for Hwb
impl UnsafeUnpin for Hwb
impl UnwindSafe for Hwb
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, T> ColorDistance<T> for C
impl<C, T> ColorDistance<T> for C
Source§impl<C, T> WcagColorContrast<T> for C
impl<C, T> WcagColorContrast<T> for C
Source§fn wcag_contrast_ratio(&self, other: T) -> f64
fn wcag_contrast_ratio(&self, other: T) -> f64
Calculate the contrast ratio between
self and other. colors according to WCAG 2.1. Returns a value between
1:1 and 21:1 Read more