pub struct Hct { /* private fields */ }Expand description
Hue, chroma and tone: CAM16 hue and chroma with L* as tone, so a tone difference predicts contrast (40 gives at least 3:1, 50 at least 4.5:1).
Implementations§
Source§impl Hct
impl Hct
Sourcepub fn from_hct(hue: f64, chroma: f64, tone: f64) -> Self
pub fn from_hct(hue: f64, chroma: f64, tone: f64) -> Self
The sRGB color closest to the request. Hue and tone are met when possible and chroma is reduced to what they allow. Non-finite inputs count as 0.
Sourcepub fn from_argb(argb: u32) -> Self
pub fn from_argb(argb: u32) -> Self
An ARGB color. The alpha channel is ignored for measurement and kept
in Self::argb.
Sourcepub fn in_viewing_conditions(&self, vc: &ViewingConditions) -> Self
pub fn in_viewing_conditions(&self, vc: &ViewingConditions) -> Self
This color as it would appear in vc, expressed in the standard
viewing conditions.
Trait Implementations§
impl Copy for Hct
impl StructuralPartialEq for Hct
Auto Trait Implementations§
impl Freeze for Hct
impl RefUnwindSafe for Hct
impl Send for Hct
impl Sync for Hct
impl Unpin for Hct
impl UnsafeUnpin for Hct
impl UnwindSafe for Hct
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