pub struct OKLCH {
pub l: f32,
pub c: f32,
pub h: f32,
pub alpha: f32,
}
Expand description
A color in the OKLCH color space.
Fields§
§l: f32
The lightness component.
c: f32
The chroma component.
h: f32
The hue component.
alpha: f32
The alpha component.
Trait Implementations§
Source§impl ColorGamut for OKLCH
impl ColorGamut for OKLCH
Source§impl ColorSpace for OKLCH
impl ColorSpace for OKLCH
Source§fn channels(&self) -> (&'static str, &'static str, &'static str)
fn channels(&self) -> (&'static str, &'static str, &'static str)
Returns the channel names for this color space.
Source§fn types(&self) -> (ChannelType, ChannelType, ChannelType)
fn types(&self) -> (ChannelType, ChannelType, ChannelType)
Returns the channel types for this color space.
Source§fn resolve_missing(&self) -> Self
fn resolve_missing(&self) -> Self
Resolves missing color components (e.g.
none
keywords) in the color.Source§impl<'de> Deserialize<'de> for OKLCH
impl<'de> Deserialize<'de> for OKLCH
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<FloatColor> for OKLCH
impl From<FloatColor> for OKLCH
Source§fn from(color: FloatColor) -> OKLCH
fn from(color: FloatColor) -> OKLCH
Converts to this type from the input type.
Source§impl From<OKLCH> for SRGBLinear
impl From<OKLCH> for SRGBLinear
Source§fn from(t: OKLCH) -> SRGBLinear
fn from(t: OKLCH) -> SRGBLinear
Converts to this type from the input type.
Source§impl From<PredefinedColor> for OKLCH
impl From<PredefinedColor> for OKLCH
Source§fn from(color: PredefinedColor) -> OKLCH
fn from(color: PredefinedColor) -> OKLCH
Converts to this type from the input type.
Source§impl From<SRGBLinear> for OKLCH
impl From<SRGBLinear> for OKLCH
Source§fn from(t: SRGBLinear) -> OKLCH
fn from(t: SRGBLinear) -> OKLCH
Converts to this type from the input type.
Source§impl Interpolate for OKLCH
impl Interpolate for OKLCH
Source§fn adjust_powerless_components(&mut self)
fn adjust_powerless_components(&mut self)
Adjusts components that are powerless to be NaN.
Source§fn adjust_hue(&mut self, other: &mut Self, method: HueInterpolationMethod)
fn adjust_hue(&mut self, other: &mut Self, method: HueInterpolationMethod)
Adjusts the color hue according to the given hue interpolation method.
Source§fn premultiply(&mut self)
fn premultiply(&mut self)
Premultiplies the color by its alpha value.
Source§fn unpremultiply(&mut self, alpha_multiplier: f32)
fn unpremultiply(&mut self, alpha_multiplier: f32)
Un-premultiplies the color by the given alpha multiplier.
Source§fn fill_missing_components(&mut self, other: &Self)
fn fill_missing_components(&mut self, other: &Self)
Fills missing components (represented as NaN) to match the other color to interpolate with.
Source§fn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self
fn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self
Interpolates the color with another using the given amounts of each.
Source§impl JsonSchema for OKLCH
impl JsonSchema for OKLCH
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl<'i, __T: Visit<'i, __T, __V>, __V: ?Sized + Visitor<'i, __T>> Visit<'i, __T, __V> for OKLCH
impl<'i, __T: Visit<'i, __T, __V>, __V: ?Sized + Visitor<'i, __T>> Visit<'i, __T, __V> for OKLCH
Source§const CHILD_TYPES: VisitTypes = _
const CHILD_TYPES: VisitTypes = _
Available on crate feature
visitor
only.The types of values contained within this value and its children.
This is used to skip branches that don’t have any values requested
by the Visitor.
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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