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ยง
- A98Rgb
- The a98-rgb color space. https://drafts.csswg.org/css-color-4/#predefined-a98-rgb
- Display
P3 - The Display-P3 color space. https://drafts.csswg.org/css-color-4/#predefined-display-p3
- Hsl
- Color specified with hue, saturation and lightness components.
- Hwb
- Color specified with hue, whiteness and blackness components.
- Lab
- The Lab color space. https://drafts.csswg.org/css-color-4/#specifying-lab-lch
- Lch
- The Lch color space. https://drafts.csswg.org/css-color-4/#specifying-lab-lch
- Oklab
- The Oklab color space. https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch
- Oklch
- The Oklch color space. https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch
- Prophoto
Rgb - The ProPhoto RGB color space. https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb
- Rec2020
- The Rec.2020 color space. https://drafts.csswg.org/css-color-4/#predefined-rec2020
- Srgb
- The sRGB color space. https://drafts.csswg.org/css-color-4/#predefined-sRGB
- Srgb
Linear - The same as sRGB color space, except the transfer function is linear light. https://drafts.csswg.org/css-color-4/#predefined-sRGB-linear
- XyzD50
- A color in the XYZ coordinate space with a D50 white reference. https://drafts.csswg.org/css-color-4/#predefined-xyz
- XyzD65
- A color in the XYZ coordinate space with a D65 white reference. https://drafts.csswg.org/css-color-4/#predefined-xyz
Enumsยง
- White
Point - A reference white that is used during color conversion.
Traitsยง
- Color
Space Conversion - A trait that allows conversion of color spaces to and from XYZ coordinate space with a specified white point.
Functionsยง
- convert_
white_ ๐point - epsilon_
for_ range - Calculate an epsilon for a specified range.
- from_
xyz - Convert the color components from XYZ at the given white point to the specified color space.
- hsl_
to_ rgb - Convert from HSL notation to RGB notation. https://drafts.csswg.org/css-color-4/#hsl-to-rgb
- hwb_
to_ rgb - Convert from HWB notation to RGB notation. https://drafts.csswg.org/css-color-4/#hwb-to-rgb
- normalize_
hue - Normalize hue into [0, 360).
- orthogonal_
to_ polar - 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
- polar_
to_ orthogonal - 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
- rgb_
to_ hsl - Convert from RGB notation to HSL notation. https://drafts.csswg.org/css-color-4/#rgb-to-hsl
- rgb_
to_ ๐hue_ min_ max - Calculate the hue from RGB components and return it along with the min and max RGB values.
- rgb_
to_ hwb - Convert from RGB notation to HWB notation. https://drafts.csswg.org/css-color-4/#rgb-to-hwb
- to_xyz
- Convert the color components from the specified color space to XYZ and return the components and the white point they are in.
- transform ๐
- xyz_
d50_ ๐to_ xyz_ d65 - xyz_
d65_ ๐to_ xyz_ d50