ColorFunction
Most graphics functions in Mathematica have a ColorFunction option. The value of a function is used to specify the color or shade of gray used to make each portion of the graphic. Some examples of ColorFunction are shown below. The "#&" notation is explained in my discussion of Slot, SlotSequence.
You will find we can't have a ColorFunction that is sometimes a color and sometimes a GrayLevel. However, we can still get the same result by using RGBColor[a,a,a] in place of GrayLevel[a] as in the next cell.
Created by Mathematica (May 16, 2004)