pub struct Lab {
pub lightness: f64,
pub a: f64,
pub b: f64,
pub alpha: f32,
}
Expand description
An CIE defined colour space representing L - perceptual lightness, and two axes A & B. The components are:
- L - a number between 0.0 and 100.0
- A - a number between -125.0 and +125.0
- B - a number between -125.0 and +125.0
- Alpha - a number between 0.0 and 100.0
Fields§
§lightness: f64
§a: f64
§b: f64
§alpha: f32
Implementations§
Trait Implementations§
impl Copy for Lab
impl StructuralPartialEq for Lab
Auto Trait Implementations§
impl Freeze for Lab
impl RefUnwindSafe for Lab
impl Send for Lab
impl Sync for Lab
impl Unpin for Lab
impl UnwindSafe for Lab
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