CSS color-interpolation-filters
The CSS color-interpolation-filters property is used in SVG to specify the color space for imaging operations performed via filter effects.
The color-interpolation-filters property can be used on any filter primitive in SVG, however, it won't have any effect on elements such as feOffset, feImage, feTile and feFlood.
The 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.
Syntax
Accepted Values
Here's a description of the accepted values.
auto(required)- 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.
sRGB(required)- Specifies that filter effects color operations should occur in the sRGB color space.
linearRGB(required)- Specifies that filter effects color operations should occur in the linearized RGB color space.
Basic Property Information
- Initial Value
linearRGB- Applies To
- All filter primitives.
- Inherited?
- Yes
- Computed Value
- As specified
- Media
- Visual
- Animatable
- No
Example Code
CSS
Here's an example when used within the style element:
Here's an example when used with the style attribute:
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 style element:
CSS Specifications
- The
color-interpolation-filtersproperty is defined in Filter Effects Module Level 1 (W3C Working Draft). - It is also defined in Scalable Vector Graphics (SVG) 1.1 (Second Edition) (W3C Recommendation 16 August 2011).
Browser Support
Browser support for CSS properties can vary, particularly for newer or experimental features. Check current browser compatibility before using a property in production, especially when supporting older browsers.
The following table provided by Caniuse.com shows the level of browser support for this feature.
Initial Value
CSS properties have an initial value that applies when the property has not been explicitly set. The initial value is different from the value inherited from a parent element and may vary between properties.
Inheritance
Some CSS properties inherit their computed value from their parent element by default, while others do not. The inherit, initial, unset, and revert keywords can also be used to control how a property gets its value.
Vendor Prefixes
Most modern CSS properties use the standard, unprefixed syntax. Vendor-prefixed properties such as -webkit- are mainly relevant to older browser versions or specific features and should only be used when required by your browser support targets.