# About Color Map

Surface visualizations in the DLMF represent functions of the form $z=f(x,y)$ by the height $z$ or the magnitude, $|z|$, for complex functions, over the $x\times y$ plane. We use color to augment these vizualizations, either to reinforce the recognition of the height, or to convey an extra dimension to represent the phase of complex valued functions.

## § Height Mapping

To provide an easily interpreted encoding of surface heights, a rainbow-like mapping of height to color is used. The following figure illustrates the piece-wise linear mapping of the height to each of the color components red, green and blue, written as $\u27e8R,G,B\u27e9$.

Mathematically, we scale the height to $h$ lying in the interval $[0,4]$ and the components are computed as follows

$$ |

## § Phase Mappings

By painting the surfaces with a color that encodes the phase, $\mathrm{ph}f$, both the magnitude and phase of complex valued functions can be displayed. We offer two options for encoding the phase.

### § Four Color Phase Mapping

The four color scheme quickly indicates in which quadrant $z$ lies: the colors blue, green, red and yellow are used to indicate the first, second, third and fourth quadrants, respectively. As a mnemonic, the colors are sorted alphabetically.

### § Continuous Phase Mapping

For the continuous phase mapping, we map the phase continuously onto the hue, as both are periodic. In doing this, however, we would like to place the mathematically significant phase values, specifically the multiples of $\pi /2$ correponding to the real and imaginary axes, at more immediately recognizable colors.

The conventional CMYK color wheel (not to be confused with the traditional Artist’s color wheel) places the additive colors (red, green, blue) and the subtractive colors (yellow, cyan, magenta) at multiples of 60 degrees. In particular, the colors at 90 and 180 degrees are some vague greenish and purplish hues.

We therefore use a piecewise linear mapping as illustrated below, that takes phase $0$ to red, $\pi /2$ to yellow, $\pi $ to cyan and $3\pi /2$ to blue.

Specifically, by scaling the phase angle in $[0,2\pi )$ to $q$ in the interval $[0,4)$, the hue (in degrees) is computed as

$$ |