pub struct Hwba { /* private fields */ }
Expand description
A color defined by hue, whiteness, blackness, and alpha.
All components are rational numbers. The hue is in degrees (0..360). The whiteness, blackness, and alpha are all in the zero to one range (inclusive), whith the additional invariant that whiteness + blackness will never be more than one.
Implementations§
source§impl Hwba
impl Hwba
sourcepub fn new(hue: Rational, w: Rational, b: Rational, alpha: Rational) -> Self
pub fn new(hue: Rational, w: Rational, b: Rational, alpha: Rational) -> Self
Create a new hwba color value.
Hue is modulo 360 degrees. Other inputs will be clamped to their ranges.
sourcepub fn whiteness(&self) -> Rational
pub fn whiteness(&self) -> Rational
Get the whiteness of this color.
Zero is no whiteness, one means this color is white.
sourcepub fn blackness(&self) -> Rational
pub fn blackness(&self) -> Rational
Get the black of this color.
Zero is no blackness, one means this color is black.
Trait Implementations§
source§impl Ord for Hwba
impl Ord for Hwba
source§impl PartialEq for Hwba
impl PartialEq for Hwba
source§impl PartialOrd for Hwba
impl PartialOrd for Hwba
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Hwba
impl StructuralPartialEq for Hwba
Auto Trait Implementations§
impl Freeze for Hwba
impl RefUnwindSafe for Hwba
impl Send for Hwba
impl Sync for Hwba
impl Unpin for Hwba
impl UnwindSafe for Hwba
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