Struct colorutils_rs::Oklab
source · pub struct Oklab {
pub l: f32,
pub a: f32,
pub b: f32,
}Expand description
Struct that represent Oklab colorspace
Fields§
§l: f32All values in Oklab intended to be normalized [0;1]
a: f32All values in Oklab intended to be normalized [0;1]
b: f32All values in Oklab intended to be normalized [0;1]
Implementations§
source§impl Oklab
impl Oklab
pub fn new(l: f32, a: f32, b: f32) -> Oklab
sourcepub fn from_srgb(rgb: Rgb<u8>) -> Oklab
pub fn from_srgb(rgb: Rgb<u8>) -> Oklab
Converts from RGB to Oklab using sRGB transfer function
sourcepub fn from_rgb(rgb: Rgb<u8>, transfer_function: TransferFunction) -> Oklab
pub fn from_rgb(rgb: Rgb<u8>, transfer_function: TransferFunction) -> Oklab
Converts from RGB to Oklab using provided transfer function
sourcepub fn to_rgb(&self, transfer_function: TransferFunction) -> Rgb<u8>
pub fn to_rgb(&self, transfer_function: TransferFunction) -> Rgb<u8>
Converts to RGB using provided transfer function
sourcepub fn to_srgb_f32(&self) -> Rgb<f32>
pub fn to_srgb_f32(&self) -> Rgb<f32>
Converts to RGB using sRGB transfer function
sourcepub fn to_rgb_f32(&self, transfer_function: TransferFunction) -> Rgb<f32>
pub fn to_rgb_f32(&self, transfer_function: TransferFunction) -> Rgb<f32>
Converts to RGB using provided transfer function
sourcepub fn to_linear_srgb(&self) -> Rgb<f32>
pub fn to_linear_srgb(&self) -> Rgb<f32>
Converts to linear RGB
Trait Implementations§
source§impl EuclideanDistance for Oklab
impl EuclideanDistance for Oklab
fn euclidean_distance(&self, other: Self) -> f32
source§impl PartialOrd for Oklab
impl PartialOrd for Oklab
source§impl TaxicabDistance for Oklab
impl TaxicabDistance for Oklab
fn taxicab_distance(&self, other: Self) -> f32
impl Copy for Oklab
impl StructuralPartialEq for Oklab
Auto Trait Implementations§
impl Freeze for Oklab
impl RefUnwindSafe for Oklab
impl Send for Oklab
impl Sync for Oklab
impl Unpin for Oklab
impl UnwindSafe for Oklab
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)