#[repr(C)]pub struct Oklch {
pub l: f32,
pub c: f32,
pub h: f32,
}Expand description
Represents Oklch colorspace
Fields§
§l: f32Lightness
c: f32Chroma
h: f32Hue
Implementations§
Source§impl Oklch
impl Oklch
Sourcepub fn from_rgb(rgb: Rgb<u8>, transfer_function: TransferFunction) -> Oklch
pub fn from_rgb(rgb: Rgb<u8>, transfer_function: TransferFunction) -> Oklch
Converts Rgb into Oklch
§Arguments
transfer_function - Transfer function into linear colorspace and its inverse
Sourcepub fn from_linear_rgb(rgb: Rgb<f32>) -> Oklch
pub fn from_linear_rgb(rgb: Rgb<f32>) -> Oklch
Sourcepub fn to_rgb(&self, transfer_function: TransferFunction) -> Rgb<u8>
pub fn to_rgb(&self, transfer_function: TransferFunction) -> Rgb<u8>
Sourcepub fn from_oklab(oklab: Oklab) -> Oklch
pub fn from_oklab(oklab: Oklab) -> Oklch
Converts Oklab to Oklch
Trait Implementations§
Source§impl AddAssign<f32> for Oklch
impl AddAssign<f32> for Oklch
Source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
Performs the
+= operation. Read moreSource§impl AddAssign for Oklch
impl AddAssign for Oklch
Source§fn add_assign(&mut self, rhs: Oklch)
fn add_assign(&mut self, rhs: Oklch)
Performs the
+= operation. Read moreSource§impl DivAssign<f32> for Oklch
impl DivAssign<f32> for Oklch
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl DivAssign for Oklch
impl DivAssign for Oklch
Source§fn div_assign(&mut self, rhs: Oklch)
fn div_assign(&mut self, rhs: Oklch)
Performs the
/= operation. Read moreSource§impl EuclideanDistance for Oklch
impl EuclideanDistance for Oklch
fn euclidean_distance(&self, other: Self) -> f32
Source§impl MulAssign<f32> for Oklch
impl MulAssign<f32> for Oklch
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl MulAssign for Oklch
impl MulAssign for Oklch
Source§fn mul_assign(&mut self, rhs: Oklch)
fn mul_assign(&mut self, rhs: Oklch)
Performs the
*= operation. Read moreSource§impl PartialOrd for Oklch
impl PartialOrd for Oklch
Source§impl SubAssign<f32> for Oklch
impl SubAssign<f32> for Oklch
Source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
Performs the
-= operation. Read moreSource§impl SubAssign for Oklch
impl SubAssign for Oklch
Source§fn sub_assign(&mut self, rhs: Oklch)
fn sub_assign(&mut self, rhs: Oklch)
Performs the
-= operation. Read moreSource§impl TaxicabDistance for Oklch
impl TaxicabDistance for Oklch
fn taxicab_distance(&self, other: Self) -> f32
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§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)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more