is a graphics directive specifying that objects that follow are to be displayed in the gray level given.


specifies opacity a.


  • GrayLevel represents shades of the gray color. represents black and represents white.
  • The gray level must be a number between 0 and 1. »
  • 0 represents black; 1 represents white.
  • On display devices with no native graylevel capability, dither patterns are typically used.
  • ColorConvert can be used to convert between GrayLevel and other color spaces.
  • The alternative forms GrayLevel[{g}] and GrayLevel[{g,a}] can also be used. »
  • Style[expr,GrayLevel[]] specifies that expr should be displayed with the specified gray level. »
  • For 3D surfaces, explicit GrayLevel directives define surface colors; the final shading depends on lighting.
  • GrayLevel[g,a] is equivalent to {GrayLevel[g],Opacity[a]}. »
  • If no opacity has been specified, GrayLevel[g] is equivalent to GrayLevel[g,1].


open allclose all

Basic Examples  (4)

Specify the gray level of graphics primitives:

Specify the gray level with opacity:

Specify the output gray level of expressions:

Specify the gray level of plots:

Scope  (1)

GrayLevel in 3D  (1)

Use diffuse surface color:

Use diffuse and specular surface color:

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

Generalizations & Extensions  (1)

Use Opacity with GrayLevel:

Use the opacity argument directly in GrayLevel:

Properties & Relations  (1)

GrayLevel of RGBColor can be computed in the following way:

From this formula we see that many colors will produce the same gray level G:

Use a color function in the RGB color space:

The corresponding gray-level colors:

Possible Issues  (2)

Gray-level values outside of the 0,1 range will be clipped:

The actual surface color depends on the colors of lights in 3D:

The default 3D lights contain several colored light sources:

Neat Examples  (2)

Visualizing the gray level with opacity:

White noise with opacity:

Wolfram Research (1988), GrayLevel, Wolfram Language function, (updated 2008).


Wolfram Research (1988), GrayLevel, Wolfram Language function, (updated 2008).


@misc{reference.wolfram_2020_graylevel, author="Wolfram Research", title="{GrayLevel}", year="2008", howpublished="\url{}", note=[Accessed: 02-December-2020 ]}


@online{reference.wolfram_2020_graylevel, organization={Wolfram Research}, title={GrayLevel}, year={2008}, url={}, note=[Accessed: 02-December-2020 ]}


Wolfram Language. 1988. "GrayLevel." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008.


Wolfram Language. (1988). GrayLevel. Wolfram Language & System Documentation Center. Retrieved from