The <hue-interpolation-method>CSSdata type represents the algorithm used for interpolation between <hue> values. The interpolation method specifies how to find a midpoint between two hue values based on a color wheel. It is used as a component of the <color-interpolation-method> data type.
When interpolating <hue> values, the hue interpolation algorithm defaults to shorter.
Syntax
A <hue-interpolation-method> value consists of the name of a hue interpolation algorithm followed by a literal token hue:
Any pair of hue angles correspond to two radii on the color wheel, which cut the circumference into two possible arcs for interpolation. Both arcs start at the first radius and end at the second radius, but one goes clockwise and the other goes counterclockwise.
Note: The following descriptions and illustrations are based on color wheels in which hue angles increase in a clockwise direction. Be aware that there are color wheels where an increase in angles will be a counterclockwise operation.
For a pair of hue angles θ1 and θ2 normalized to the range [0deg, 360deg), there are four algorithms to determine which arc is used when interpolating from θ1 to θ2:
Use the counterclockwise arc. When the two radii coincide, the arc degenerates to a single point.
θ1 = 45deg, θ2 = 135deg
θ1 = 135deg, θ2 = 45deg
As there are only two arcs to choose from, these algorithms are pairwise equivalent under certain circumstances. Specifically:
If 0deg < θ2 - θ1 < 180deg or θ2 - θ1 < -180deg, shorter and increasing are equivalent, whereas longer and decreasing are equivalent.
If -180deg < θ2 - θ1 < 0deg or θ2 - θ1 > 180deg, shorter and decreasing are equivalent, whereas longer and increasing are equivalent.
A notable feature of increasing and decreasing is that when the hue angle difference passes through 180deg during transition or animation, the arc will not flip to the other side like shorter and longer do.