Changing the hue of a color may be accomplished by loading a rotation
about the gray vector . This operation may be performed in
one step using the `glRotate()` command. The matrix may also be
constructed via the following steps [42]:

- 49.
- Load the identity matrix (
`glLoadIdentity()`). - 50.
- Rotate such that the gray vector maps onto the
axis using the
`glRotate()`command. - 51.
- Rotate about the axis to adjust the hue
(
`glRotate<degrees>, 0, 0, 1(<degrees>, 0, 0, 1)`). - 52.
- Rotate the gray vector back into position.

you realize the plane of constant luminance is defined by:

Therefore, the vector is perpendicular to planes of constant luminance. The algorithm for matrix construction becomes the following [42]:

- 53.
- Load the identity matrix.
- 54.
- Apply a rotation matrix such that the gray vector maps onto the positive axis.
- 55.
- Compute
. Apply a skew
transform which maps
to . This
matrix is:

- 56.
- Rotate about the axis to adjust the hue.
- 57.
- Apply the inverse of the shear matrix.
- 58.
- Apply the inverse of the rotation matrix.