Expand description
cbindgen:ignore Color conversion algorithms.
Algorithms, matrices and constants are from the [color-4] specification, unless otherwise specified:
https://drafts.csswg.org/css-color-4/#color-conversion-code
NOTE: Matrices has to be transposed from the examples in the spec for use
with the euclid
library.
Structs§
- The a98-rgb color space. https://drafts.csswg.org/css-color-4/#predefined-a98-rgb
- The Display-P3 color space. https://drafts.csswg.org/css-color-4/#predefined-display-p3
- Color specified with hue, saturation and lightness components.
- Color specified with hue, whiteness and blackness components.
- The Lab color space. https://drafts.csswg.org/css-color-4/#specifying-lab-lch
- The Lch color space. https://drafts.csswg.org/css-color-4/#specifying-lab-lch
- The Oklab color space. https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch
- The Oklch color space. https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch
- The ProPhoto RGB color space. https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb
- The Rec.2020 color space. https://drafts.csswg.org/css-color-4/#predefined-rec2020
- The sRGB color space. https://drafts.csswg.org/css-color-4/#predefined-sRGB
- The same as sRGB color space, except the transfer function is linear light. https://drafts.csswg.org/css-color-4/#predefined-sRGB-linear
- A color in the XYZ coordinate space with a D50 white reference. https://drafts.csswg.org/css-color-4/#predefined-xyz
- A color in the XYZ coordinate space with a D65 white reference. https://drafts.csswg.org/css-color-4/#predefined-xyz
Enums§
- A reference white that is used during color conversion.
Traits§
- A trait that allows conversion of color spaces to and from XYZ coordinate space with a specified white point.
Functions§
- Calculate an epsilon for a specified range.
- Convert the color components from XYZ at the given white point to the specified color space.
- Convert from HSL notation to RGB notation. https://drafts.csswg.org/css-color-4/#hsl-to-rgb
- Convert from HWB notation to RGB notation. https://drafts.csswg.org/css-color-4/#hwb-to-rgb
- Normalize hue into [0, 360).
- Convert from the rectangular orthogonal to the cylindrical polar coordinate system. This is used to convert (ok)lab to (ok)lch. https://drafts.csswg.org/css-color-4/#lab-to-lch
- Convert from the cylindrical polar to the rectangular orthogonal coordinate system. This is used to convert (ok)lch to (ok)lab. https://drafts.csswg.org/css-color-4/#lch-to-lab
- Convert from RGB notation to HSL notation. https://drafts.csswg.org/css-color-4/#rgb-to-hsl
- Calculate the hue from RGB components and return it along with the min and max RGB values.
- Convert from RGB notation to HWB notation. https://drafts.csswg.org/css-color-4/#rgb-to-hwb
- Convert the color components from the specified color space to XYZ and return the components and the white point they are in.
Type Aliases§
- Vector 🔒