Skip to main content

Oklch

Struct Oklch 

Source
pub struct Oklch {
    pub l: f32,
    pub c: f32,
    pub h: f32,
    pub a: f32,
}
Expand description

A color in the Oklab color space, represented as Oklch.

Fields§

§l: f32

Perceptual lightness: 0 is pure black, 1 is pure white.

§c: f32

Chromatic intensity: 0 is achromatic, +0.5 is usually the upper limit.

§h: f32

Hue angle, in radians.

§a: f32

Alpha channel.

Trait Implementations§

Source§

impl From<Color> for Oklch

Source§

fn from(color: Color) -> Self

Converts to this type from the input type.
Source§

impl From<Oklch> for Color

Source§

fn from(oklch: Oklch) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Oklch

§

impl RefUnwindSafe for Oklch

§

impl Send for Oklch

§

impl Sync for Oklch

§

impl Unpin for Oklch

§

impl UnsafeUnpin for Oklch

§

impl UnwindSafe for Oklch

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.