# The Color Cube

## Branko Ćurgus

In many math classes we work with vectors. I love to use colors to clarify relationship between various mathematical quantities that we encounter. Therefore it is useful to present how colors can be organized using vectors in the unit cube.
• All colors are identified in Mathematica (or in the RGB coloring scheme in general) by a vector $\displaystyle \begin{bmatrix}x \\ y \\ z\end{bmatrix}$ with $0 \leq x \leq 1$, $0 \leq y \leq 1$, $0 \leq z \leq 1$. In other words, Mathematica identifies colors with the points in the unit cube in the $xyz$-space. In this setting the unit cube is called The Color Cube.
• Below is an image of the color cube with 27 colors emphasized.
• Some of the colors emphasized below have common names. For others I tried to find appropriate names.
• Here I adopt following mathematical definitions of dark and light adjectives for colors: For a specific COLOR we define the dark COLOR to be the color which is half-way between COLOR and BLACK, that is the vector corresponding to the COLOR scaled by $1/2$. For a specific COLOR we define the light COLOR to be the color which is half-way between COLOR and WHITE, that is the sum of the vector $(1/2,1/2,1/2)$ and the vector corresponding to the COLOR scaled by $1/2$.
• In this terminology maroon is just dark red, navy is dark blue, teal is dark cyan, purple is dark magenta, olive is dark yellow, gray is light black, or gray is dark white, salmon is light red, ultra pink is light magenta.
$\displaystyle \begin{bmatrix}0 \\ 0 \\0\end{bmatrix}$   Black $\displaystyle \begin{bmatrix}1/2 \\ 1/2 \\ 1/2\end{bmatrix}$  Gray $\displaystyle \begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix}$  White
$\displaystyle \begin{bmatrix}1 \\ 0 \\0\end{bmatrix}$   Red $\displaystyle \begin{bmatrix}1/2 \\ 0 \\0\end{bmatrix}$   Maroon $\displaystyle \begin{bmatrix}1/2 \\ 1/2 \\0\end{bmatrix}$   Olive $\displaystyle \begin{bmatrix}1 \\ 1/2 \\0\end{bmatrix}$   Orange $\displaystyle \begin{bmatrix}1 \\ 1 \\0\end{bmatrix}$   Yellow
$\displaystyle \begin{bmatrix}0 \\ 1 \\0\end{bmatrix}$   Green
$\displaystyle \begin{bmatrix}0 \\ 1/2 \\0\end{bmatrix}$
Dark
Green
$\displaystyle \begin{bmatrix}1/2 \\ 1 \\0\end{bmatrix}$ Chartruse $\displaystyle \begin{bmatrix}0 \\ 1/2 \\ 1/2\end{bmatrix}$ Teal
$\displaystyle \begin{bmatrix}0 \\ 1 \\1/2\end{bmatrix}$
Spring
Green
$\displaystyle \begin{bmatrix}0 \\ 0 \\1\end{bmatrix}$   Blue $\displaystyle \begin{bmatrix}0 \\ 0 \\ 1/2\end{bmatrix}$  Navy $\displaystyle \begin{bmatrix}1/2 \\ 0 \\ 1/2\end{bmatrix}$  Purple $\displaystyle \begin{bmatrix}1 \\ 0 \\ 1\end{bmatrix}$  Magenta $\displaystyle \begin{bmatrix}0 \\ 1 \\ 1\end{bmatrix}$  Cyan
$\displaystyle \begin{bmatrix}1/2 \\ 0 \\ 1\end{bmatrix}$
Dark
Violet
$\displaystyle \begin{bmatrix}0 \\ 1/2 \\1\end{bmatrix}$
Sky
Blue
$\displaystyle \begin{bmatrix}1/2 \\ 1/2 \\ 1\end{bmatrix}$
Light
Blue
$\displaystyle \begin{bmatrix} 1 \\ 1/2 \\1\end{bmatrix}$
Ultra
Pink
$\displaystyle \begin{bmatrix} 1/2 \\ 1 \\1 \end{bmatrix}$
Light
Cyan
$\displaystyle \begin{bmatrix}1 \\ 0 \\ 1/2 \end{bmatrix}$
Magenta
Red
$\displaystyle \begin{bmatrix} 1 \\ 1/2 \\ 1/2 \end{bmatrix}$  Salmon
$\displaystyle \begin{bmatrix}1 \\ 1 \\ 1/2 \end{bmatrix}$
Light
Yellow
$\displaystyle \begin{bmatrix}1/2 \\ 1 \\ 1/2 \end{bmatrix}$
Light
Green

27 special colors in the Color Cube

Place the cursor over the image to start the animation.

• Thinking of colors as vectors helps us to understand a transition between two colors.

Place the cursor over the image to start the animation.

Since Teal and Yellow are the heads of particular vectors in the Color Cube, to construct a transition I connected the heads with a line segment. Points on this line segment are the heads of special linear combinations of the vectors representing Teal and Yellow. As an exercise write the linear combinations which are used in the above transition.

• As we have seen at the beginning of this page the vector $\displaystyle \begin{bmatrix}0 \\ 1/2 \\ 1/2\end{bmatrix}$ represents Teal and the vector $\displaystyle \begin{bmatrix}1 \\ 1 \\ 0 \end{bmatrix}$ represents Yellow. What are the vectors representing the transitional colors in the animation above and two animations below? The answer is indicated in the animation above. The moving points colored by transitional colors move along the vector parallel to the vector $\begin{bmatrix}1 \\ 1 \\ 0\end{bmatrix} - \begin{bmatrix}0 \\ 1/2 \\ 1/2\end{bmatrix}.$ To represent all different points along this vector I scale it by a scalar $s \in [0,1]$, and to start from the head of Teal, I add the teal vector $\begin{bmatrix}0 \\ 1/2 \\ 1/2\end{bmatrix} + s \left( \begin{bmatrix}1 \\ 1 \\ 0\end{bmatrix} - \begin{bmatrix}0 \\ 1/2 \\ 1/2\end{bmatrix}\right) = (1-s)\begin{bmatrix}0 \\ 1/2 \\ 1/2\end{bmatrix} + s \begin{bmatrix}1 \\ 1 \\ 0\end{bmatrix} = \begin{bmatrix} s \\ (1+s)/2 \\ (1-s)/2\end{bmatrix}.$ We can see from the preceding formula that at $s=0$ the point starts at Teal and at the value $s=1$ it reaches Yellow. For values of $s$ between $0$ and $1$ all the points on the line segment between Teal and Yellow are colored. For $s=1/2$ we obtain the color which is exactly half-way between Teal and Yellow.
• The construction in the preceding item is universal. If we are given two vectors $\mathbf{u}$ and $\mathbf{v}$ the formula $(1-s) \mathbf{u} + s \mathbf{v} \qquad s \in [0,1]$ represents vectors whose heads are along the closed line segment connecting the heads of $\mathbf{u}$ and $\mathbf{v}.$ The preceding linear combination of vectors $\mathbf{u}$ and $\mathbf{v}$ is called a convex linear combination of two vectors.
• Two more ways of explore a transition between Teal and Yellow.

Place the cursor over the image to start the animation.

In the above animation I used the colors from the line segment connecting Teal and Yellow to color the rectangles in the middle of the square.

Above is the unit circle colored using colors from the line segment connecting Teal and Yellow.