Skip to content

Commit

Permalink
Merge pull request svg#637 from AlimovSV/master
Browse files Browse the repository at this point in the history
More options for setting "currentColor"
  • Loading branch information
GreLI authored Dec 20, 2016
2 parents f33baaa + dc25905 commit a672b61
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/convertColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,17 @@ exports.fn = function(item, params) {
match;

// Convert colors to currentColor
if (params.currentColor && (match = !val.match(none))) {
val = 'currentColor';
if (params.currentColor) {
if (typeof params.currentColor === 'string') {
match = val === params.currentColor;
} else if (params.currentColor.exec) {
match = params.currentColor.exec(val);
} else {
match = !val.match(none);
}
if (match) {
val = 'currentColor';
}
}

// Convert color name keyword to long hex
Expand Down

0 comments on commit a672b61

Please sign in to comment.