Skip to content

Instantly share code, notes, and snippets.

@mathieudutour mathieudutour/sRGB-blur.js

Last active Jul 22, 2020
What would you like to do?
SVGO plugin to fix color space issue in Safari on SVG Filter primitives
'use strict';
exports.type = 'perItem'; = true;
exports.description = 'add color-interpolation-filters="sRGB" to filters';
exports.params = {
force: false,
key: 'color-interpolation-filters',
value: 'sRGB',
tags: ['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'feSpecularLighting', 'feTile', 'feTurbulence']
exports.fn = function(item, params) {
if ((params.tags || []).every(function (tag) {
return !item.isElem(String(tag));
})) {
if (!params.force && item.hasAttr(String(params.key))) {
if (!item.attrs) {
item.attrs = {}
item.attrs[String(params.key)] = {
name: String(params.key),
value: String(params.value),
prefix: '',
local: String(params.key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.