Click or drag to resize

Hue is a cyclic spectrum indicating a color's base from the variety of pure colors of the color wheel. These range from red, through yellow, green, cyan, blue, magenta, and back to red.

The hue spectrum.

Range and Values

Hue is often represented as an angle, since it corresponds to a cyclic spectrum that can be projected onto a circle. Red is traditionally set as 0°, green at 120°, and blue at 240°. The secondary colors are therefore yellow at 60°, cyan at 180°, and magenta at 300°.

In the Make It Colorful library, hue is scaled to a range of [0, 1), so to convert, just divide the typical degree value by 360. Red is still at 0, but green is at 1/3 and blue is at 2/3. Likewise, yellow is at 1/6, cyan at 1/2, and magenta at 5/6.

Hue values outside the range [0, 1) are still considered valid, but when necessary will be automatically and temporarily truncated to that range. If you ever need to do the same thing manually, simply use the following code:

hue = UnityEngine.Mathf.Repeat(hue, 1f);

See Also