Enum Color Copy item path Source pub enum Color {
Show 33 variants Rgb(Rgb ),
LinearRgb(LinearRgb ),
Hsl(Hsl ),
Hsv(Hsv ),
Hwb(Hwb ),
Lab(Lab ),
Lab65(Lab65 ),
Lch(Lch ),
Lch65(Lch65 ),
Oklab(Oklab ),
Oklch(Oklch ),
Xyz50(Xyz50 ),
Xyz65(Xyz65 ),
P3(P3 ),
Rec2020(Rec2020 ),
A98(A98 ),
ProphotoRgb(ProphotoRgb ),
Cubehelix(Cubehelix ),
Dlab(Dlab ),
Dlch(Dlch ),
Jab(Jab ),
Jch(Jch ),
Yiq(Yiq ),
Hsi(Hsi ),
Hsluv(Hsluv ),
Hpluv(Hpluv ),
Okhsl(Okhsl ),
Okhsv(Okhsv ),
Itp(Itp ),
Xyb(Xyb ),
Luv(Luv ),
Lchuv(Lchuv ),
Prismatic(Prismatic ),
}Expand description Tagged union over every supported color space. Variants are added as each
space lands.
HWB (hue/whiteness/blackness).
CIE Lch D65 (polar Lab65).
Oklab (perceptually uniform).
Cubehelix (Dave Green’s astronomical color scheme as a space).
DIN99o Lab (rectangular form of DIN99o LCh).
JzAzBz (HDR perceptual Lab).
JzCzHz (polar form of JzAzBz).
HSI (Hue/Saturation/Intensity).
HSLuv (perceptually uniform HSL).
HPLuv (perceptually uniform HSL, pastel).
OkHSL (Oklab-derived HSL).
OkHSV (Oklab-derived HSV).
ICtCp (HDR perceptual, Rec. BT.2100).
CIELChuv (polar form of CIELUV).
Prismatic (intensity + barycentric chromaticity, Hauke 2009).
culors extension; not in culori 4.0.2.
Returns the culori mode string for this color’s underlying space
("rgb", "lab", "oklch", etc.). Identical to the corresponding
space struct’s ColorSpace::MODE .
Convert this color to the named target color space, mirroring culori’s
converter(target_mode)(self) dispatch.
Returns None if target_mode is not a recognized culori mode string.
Recognized modes match the ColorSpace::MODE constants of every space
implemented by this crate ("rgb", "hsl", "hsv", "hwb", "lab",
"lab65", "lch", "lch65", "oklab", "oklch", "xyz50", "xyz65",
"p3", "rec2020", "a98", "prophoto", "lrgb", "cubehelix",
"dlab", "dlch", "jab", "jch", "yiq", "hsi", "hsluv",
"hpluv", "okhsl", "okhsv", "itp", "xyb", "luv", "lchuv",
"prismatic").
§ Routing semantics
For every pair (from, target_mode) where culori 4.0.2’s converters
table has a direct entry, this method takes the same path. For pairs
without a direct entry, both this method and culori route through rgb.
Output agrees with culori.converter(target_mode)(self) to within
1e-13 per channel across the full pair matrix (see fixture suite).
Contrast with crate::convert() which always routes through XYZ D65
and so accumulates ~1e-14 drift on pairs where culori takes a shorter
path.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.