Favorites

CSS <hue-interpolation-method> Data Type

<hue-interpolation-method>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

The <hue-interpolation-method> data type sets which way round the color wheel hues are mixed: shorter, longer, increasing or decreasing hue.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The <hue-interpolation-method> CSS data type chooses which way around the color wheel the hue travels when the browser blends two colors in a polar color space (hsl, hwb, lch or oklch). Because hue is an angle, there are always two possible paths between two hues: the short way and the long way round. This type is written after the color space in a <color-interpolation-method>, for example in oklch longer hue, in color-mix() and in gradients.

shorter hue is the default and takes the shorter arc, so a blend from red (0deg) to blue (240deg) passes through magenta. longer hue takes the longer arc, through yellow, green and cyan, which is the easy way to make a rainbow. increasing hue always moves to higher angles (clockwise) and decreasing hue always moves to lower angles, whichever arc is shorter; these are useful when animating hues in a consistent direction.

A notable trick: a gradient from a color to itself is normally a solid color, but with longer hue the hue travels the full 360 degrees, giving a complete spectrum, for example linear-gradient(in hsl longer hue, red, red).

Examples:

.short {
  background: linear-gradient(in oklch shorter hue to right, oklch(70% 0.2 30), oklch(70% 0.2 270));
}

.long {
  background: linear-gradient(in oklch longer hue to right, oklch(70% 0.2 30), oklch(70% 0.2 270));
}

.spectrum {
  background: conic-gradient(in hsl longer hue, red, red);
}

Interactive Demo

Demo Code
HTML Code
<div class="demo-element"></div>
CSS Code
.demo-element {
	width: 280px;
	height: 70px;
	border-radius: 8px;
	background: linear-gradient(to right in hsl, #f72585, #4cc9f0);
}

Syntax

<hue-interpolation-method> = [ shorter | longer | increasing | decreasing ] hue

Values

  • shorter hueInterpolates along the shorter arc between the two hues. This is the default.
  • longer hueInterpolates along the longer arc between the two hues.
  • increasing hueAlways interpolates toward higher hue angles (clockwise), whichever arc that is.
  • decreasing hueAlways interpolates toward lower hue angles (counter-clockwise), whichever arc that is.

Example

<div class="wrap">
<h1>CSS &lt;hue-interpolation-method&gt; examples</h1>
<div class="grid">
<div class="card">
<div class="sw shorter"></div>
<div class="label">in oklch shorter hue</div>
</div>
<div class="card">
<div class="sw longer"></div>
<div class="label">in oklch longer hue</div>
</div>
<div class="card">
<div class="sw increasing"></div>
<div class="label">in hsl increasing hue (300deg to 60deg)</div>
</div>
<div class="card">
<div class="sw decreasing"></div>
<div class="label">in hsl decreasing hue (300deg to 60deg)</div>
</div>
<div class="card">
<div class="sw spectrum"></div>
<div class="label">conic-gradient(in hsl longer hue, red, red)</div>
</div>
</div>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
.sw {
  height: 70px;
  border-radius: 8px;
}

.shorter { background: linear-gradient(in oklch shorter hue to right, oklch(70% 0.18 30), oklch(70% 0.18 270)); }
.longer { background: linear-gradient(in oklch longer hue to right, oklch(70% 0.18 30), oklch(70% 0.18 270)); }
.increasing { background: linear-gradient(in hsl increasing hue to right, hsl(300 80% 55%), hsl(60 80% 55%)); }
.decreasing { background: linear-gradient(in hsl decreasing hue to right, hsl(300 80% 55%), hsl(60 80% 55%)); }
.spectrum { height: 140px; width: 140px; margin: 0 auto; border-radius: 50%; background: conic-gradient(in hsl longer hue, red, red); }
Open in editor

Browser Support

The following information will show you the current browser support for the CSS hue-interpolation-method data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.

This data type is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.