Skip to main content Crate chromashift Copy item path Source A98Rgb A colour in the Adobe RGB (1998) colour space.
The components are: Chromaticity A CIE 1931 xy chromaticity: a colour’s hue and purity with its luminance factored out. DisplayP3 A colour in the Display P3 colour space.
The components are: Hex An Hex representation of the sRGB colour space. Hsl An colour represented as Hue, Saturation, and Lightness expressed in the sRGB colour space.
The components are: Hsv An colour represented as Hue, Saturation, and Value expressed in the sRGB colour space.
The components are: Hwb An colour represented as Hue, Whiteness, and Blackness expressed in the sRGB colour space.
The components are: Lab An CIE defined colour space representing L - perceptual lightness, and two axes A & B.
The components are: Lch A cylindrical colour space representing within the CIE colour space.
The components are: LinearRgb A device independent expression of RGB: the sRGB primaries with no transfer function.
The components are: Matrix3 A 3x3 matrix of f64 , as used for linear colour space conversions. Oklab A more adequate expression of LAB, in the CIE colour space.
The components are: Oklch A more adequate expression of LCH, in the CIE colour space.
The components are: ProphotoRgb A colour in the ProPhoto RGB colour space (ROMM RGB).
The components are: Rec2020 A colour in the ITU-R BT.2020 colour space.
The components are: RgbSpace A description of an RGB colour space: its white point, and how to move between its encoded channels and CIE XYZ. Srgb A colour in the sRGB colour space.
The components are: XyzD50 A colour expressed as X, Y and Z values in the CIE XYZ tristimulus colour space, with an explicit D50 white
point.
The components are: XyzD65 A colour expressed as X, Y and Z values in the CIE XYZ tristimulus colour space, with an explicit D65 white
point.
The components are: Color Any colour this crate can represent, in the colour space it was authored in. ColorSpace Identifies a colour space for gamut containment checks. HueInterpolation A direction hues travel in between two colours, when interpolating in a polar space. InterpolationSpace A colour space colours can be interpolated in, with the direction hues travel in for polar spaces, as named by CSS
<color-interpolation-method>. Named ToNamedError Transfer The transfer function (a.k.a. “gamma”) pairing a linear light value with its encoded form. WcagLevel WCAG 2.1 color contrast levels COLOR_EPSILON The CIE Delta E distance below which two colours are considered perceptually identical. ColorDistance Trait for calculating perceptual color distance between colors. ColorMix Trait for calculating mixing two colors together. Gamut Whether a colour is within the natural bounds of its colour space, and the ability to produce a naively clamped
version or a perceptually gamut-mapped version. PerceptualRound Rounds a colour’s channels to perceptually safe precision. ToAlpha Trait for extracting the alpha channel of a color. WcagColorContrast Trait for calculating WCAG specified color contrast between colors. round_dp Rounds f to d decimal places. Channel A generic single color channel value, which may be None