CSS <hue> Data Type
The <hue> data type is the angle of a color around the color wheel, written as a number or angle, as used by hsl(), hwb(), lch() and oklch().
Description
The <hue> CSS data type represents the hue angle of a color: its position around a color wheel. It is used as a component in color functions that describe colors with a hue, including hsl(), hwb(), lch() and oklch(). Changing only the hue while keeping the other components the same lets you move from red through yellow, green, cyan, blue and magenta and back to red again.
A <hue> can be written as an <angle>, such as 120deg, 0.5turn or 3.1416rad, or as a plain <number>, which is treated as degrees. Because it is an angle, the value wraps around: 360deg is the same as 0deg, 480deg is the same as 120deg, and negative values count backwards, so -60deg equals 300deg. In hsl() and hwb(), 0deg is red, 120deg is green and 240deg is blue. In lch() and oklch() the same angles produce slightly different colors, because those color spaces are arranged by how humans perceive color.
In the modern space-separated color syntax, the hue can also be the keyword none, which means the hue is missing. This is useful for grays and when mixing colors. Hue also matters when colors are interpolated, for example in gradients and color-mix(), where hue interpolation methods (shorter, longer, increasing and decreasing) control which way around the wheel the transition travels.
Examples:
/* Hue as a plain number (degrees) */
.green {
color: hsl(120 100% 35%);
}
/* Hue as an angle in turns */
.cyan {
background-color: hsl(0.5turn 80% 50%);
}
/* Hue in a perceptual color space */
.brand {
background-color: oklch(65% 0.2 250deg);
}
/* Rainbow gradient travelling the long way around the wheel */
.rainbow {
background: linear-gradient(to right in hsl longer hue, red, red);
}
Because hue is a single number, it is easy to animate or calculate with custom properties, which makes it ideal for building color themes from one base hue.
Interactive Demo
Syntax
<hue> = <number> | <angle>
Values
- <number>A plain number, interpreted as an angle in degrees. For example, 240 is the same as 240deg.
- <angle>An angle using deg, grad, rad or turn units. Refer to <angle> for possible values. Values outside 0deg to 360deg wrap around the color wheel.
Example
Browser Support
The following information will show you the current browser support for the CSS hue data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





