rgb2xyz: RGB to CIE XYZ Color Space Conversion
Device-Independent Color Transformation
The rgb2xyz
function converts RGB color values to the CIE XYZ color space, which serves as an intermediate step for color space transformations. XYZ space provides a device-independent representation based on human vision standardization.
Mathematical Foundation
The transformation uses the sRGB to CIE XYZ D65 standard matrix:
This matrix assumes linear RGB values. The Y component represents luminance, while X and Z define chromaticity coordinates.
XYZ Chromaticity Decomposition
ライブエディター
const fragment = () => { const rgbColor = vec3(uv.x, uv.y, 0.5) const xyzColor = rgb2xyz(rgbColor) return vec4(xyzColor, 1) }