pub struct Oklch {
pub lightness: f64,
pub chroma: f64,
pub hue: f64,
pub alpha: f32,
}
Expand description
A more adequate expression of LCH, in the CIE colour space. The components are:
- Lightness / Luminance - a number between 0.0 and 100.0
- Chroma - a number between 0.0 and 150.0
- Hue - a number between 0.0 and 360.0
- Alpha - a number between 0.0 and 100.0
Fields§
§lightness: f64
§chroma: f64
§hue: f64
§alpha: f32
Implementations§
Trait Implementations§
Source§impl<T, U> ColorMixPolar<T, U> for Oklch
impl<T, U> ColorMixPolar<T, U> for Oklch
fn mix_polar( first: T, second: U, percentage: f64, hue_interpolation: HueInterpolation, ) -> Self
impl Copy for Oklch
impl StructuralPartialEq for Oklch
Auto Trait Implementations§
impl Freeze for Oklch
impl RefUnwindSafe for Oklch
impl Send for Oklch
impl Sync for Oklch
impl Unpin for Oklch
impl UnwindSafe for Oklch
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