Favorites

CSS color-interpolation Property

color-interpolation
CSS PropertyThis property is supported by all modern browsers.
Updated 22nd November 2026

The color-interpolation property sets the color space used for SVG gradients, compositing and animations: sRGB or linearRGB.

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 color-interpolation property chooses the color space in which SVG gradients, compositing and animations interpolate colors. With the default sRGB colors are blended in the gamma-encoded sRGB space; with linearRGB they are blended in linear light, which gives brighter, more physically accurate midpoints, for example a red-to-green gradient that does not pass through a muddy brown.

It applies to SVG container elements, graphics elements, gradients and <animate> elements. Filter effects use the separate color-interpolation-filters property. For CSS gradients, the color space is chosen with the in keyword instead, as in linear-gradient(in oklab, red, blue).

Definition

Initial value
sRGB
Applies to
container elements, graphics elements, gradient elements, use and animate elements in SVG
Inherited
yes
Computed value
as specified
Animatable
discrete
JavaScript syntax
object.style.colorInterpolation

Interactive Demo

Demo Code
HTML Code
<svg class="demo-svg" viewBox="0 0 200 120" width="260" xmlns="http://www.w3.org/2000/svg">
<defs>
	<linearGradient class="demo-element" id="demo-ci-grad">
		<stop offset="0" stop-color="#ff0000"/>
		<stop offset="1" stop-color="#00ff00"/>
	</linearGradient>
</defs>
<rect x="10" y="20" width="180" height="80" rx="8" fill="url(#demo-ci-grad)"/>
</svg>
CSS Code
.demo-element {
	color-interpolation: auto;
}

Syntax

color-interpolation: auto | sRGB | linearRGB;

Values

  • autoThe browser may choose either color space.
  • sRGBThe default. Colors are interpolated in the sRGB color space.
  • linearRGBColors are interpolated in linearized RGB (linear light).
  • initialSets the property to its initial value.
  • inheritTakes the computed value of the parent element.

Example

<svg viewBox="0 0 300 160">
<defs>
<linearGradient id="g1" class="srgb"><stop offset="0" stop-color="red"/><stop offset="1" stop-color="lime"/></linearGradient>
<linearGradient id="g2" class="linear"><stop offset="0" stop-color="red"/><stop offset="1" stop-color="lime"/></linearGradient>
</defs>
<rect x="10" y="20" width="280" height="40" fill="url(#g1)"/>
<text x="10" y="76">sRGB</text>
<rect x="10" y="90" width="280" height="40" fill="url(#g2)"/>
<text x="10" y="148">linearRGB</text>
</svg>
svg {
  width: 300px;
  height: 160px;
  border: 1px solid #ddd;
  background: #fafbff;
}

.linear {
  color-interpolation: linearRGB;
}

.srgb {
  color-interpolation: sRGB;
}

text {
  font: 14px system-ui, sans-serif;
}
Open in editor

Browser Support

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

This property 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.