is a color directive with tristimulus values x, y, and z.


specifies opacity α.


  • XYZColor is a color space defined in terms of standard responses to a power spectrum. It was the first standard quantitative color space and allows for objective comparison of colors.
  • XYZColor is device independent and corresponds to the CIE 1931 color space.
  • The parameters have the following interpretation:
  • xcolor, combination of green and red
    yapproximate luminance
    zcolor, approximately blue
  • The parameters x, y, and z are given by , , and , where , , and are the CIE standard observer color-matching functions, the spectral power distribution, and the wavelength in nanometers.
  • XYZColor allows any non-negative real number for x, y, and z; negative values will be clipped.
  • RGBColor approximately corresponds to x between 0 and 0.97, y between 0 and 1, and z between 0 and 0.83.
  • ColorConvert can be used to convert XYZColor to other color spaces.
  • The alternative forms XYZColor[{x,y,z}] and XYZColor[{x,y,z,a}] can also be used. »
  • {XYZColor[], p1, } indicates that graphics primitives pi should be displayed in the color given.
  • Style[expr,XYZColor[]] specifies that expr should be displayed with the specified color. »
  • For 3D surfaces, explicit XYZColor directives define surface colors; the final shading depends on lighting and contributions from specularity and glow. »
  • Glow[XYZColor[]] specifies color independent of lighting. »
  • XYZColor[x,y,z,a] is equivalent to Directive[XYZColor[x,y,z],Opacity[a]]. »
  • If no opacity has been specified, XYZColor[x,y,z] is equivalent to XYZColor[x,y,z,1].


open allclose all

Basic Examples  (4)

Specify the color of graphics primitives:

Specify the color with opacity:

Specify the output color of expressions:

Specify the color of plots:

Scope  (3)

Colors in 3D  (1)

Use diffuse surface color:

Use diffuse and specular surface color:

Use glow color, setting the diffuse surface color to black:

Color Operations  (2)

Use Blend to mix two or more colors:

Use Lighter and Darker to mix with white and black, respectively:

Generalizations & Extensions  (2)

XYZColor[{X,Y,Z}] is equivalent to XYZColor[X,Y,Z]:

Use Opacity with XYZColor:

Use the opacity argument in XYZColor directly:

Neat Examples  (1)

Visualizing the XYZ color space:

Wolfram Research (2014), XYZColor, Wolfram Language function,


Wolfram Research (2014), XYZColor, Wolfram Language function,


@misc{reference.wolfram_2020_xyzcolor, author="Wolfram Research", title="{XYZColor}", year="2014", howpublished="\url{}", note=[Accessed: 02-March-2021 ]}


@online{reference.wolfram_2020_xyzcolor, organization={Wolfram Research}, title={XYZColor}, year={2014}, url={}, note=[Accessed: 02-March-2021 ]}


Wolfram Language. 2014. "XYZColor." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2014). XYZColor. Wolfram Language & System Documentation Center. Retrieved from