color-interpolation-filters property is used in SVG to specify the color space for imaging operations performed via filter effects.
color-interpolation-filters property can be used on any filter primitive in SVG, however, it won't have any effect on elements such as
color-interpolation-filters property has a corresponding presentation attribute for SVG elements. Therefore, you can use
color-interpolation-filters in a style sheet or as a presentation attribute.
Here's a description of the accepted values.
- Indicates that the user agent can choose either the sRGB or linearRGB spaces for filter effects color operations. You can use this if you don't require that color operations occur in a particular color space.
- Specifies that filter effects color operations should occur in the sRGB color space.
- Specifies that filter effects color operations should occur in the linearized RGB color space.
Basic Property Information
- Initial Value
- Applies To
- All filter primitives.
- Computed Value
- As specified
Here's an example when used within the
Here's an example when used with the
As a Presentation Attribute
Here's an example when used as an SVG presentation attribute:
Working Example within an SVG Document
Here's a full working example when used within the
color-interpolation-filtersproperty is defined in Filter Effects Module Level 1 (W3C Working Draft, 18 December 2018).
- It is also defined in Scalable Vector Graphics (SVG) 1.1 (Second Edition) (W3C Recommendation 16 August 2011).
For maximum browser compatibility many web developers add browser-specific properties by using extensions such as
-webkit- for Safari, Google Chrome, and Opera (newer versions),
-ms- for Internet Explorer,
-moz- for Firefox,
-o- for older versions of Opera etc. As with any CSS property, if a browser doesn't support a proprietary extension, it will simply ignore it.
This practice is not recommended by the W3C, however in many cases, the only way you can test a property is to include the CSS extension that is compatible with your browser.
The major browser manufacturers generally strive to adhere to the W3C specifications, and when they support a non-prefixed property, they typically remove the prefixed version. Also, W3C advises vendors to remove their prefixes for properties that reach Candidate Recommendation status.
Many developers use Autoprefixer, which is a postprocessor for CSS. Autoprefixer automatically adds vendor prefixes to your CSS so that you don't need to. It also removes old, unnecessary prefixes from your CSS.
You can also use Autoprefixer with preprocessors such as Less and Sass.