Skip to content

Commit

Permalink
Merge pull request #760 from davidleston/#759-upper-case-hex-to-short…
Browse files Browse the repository at this point in the history
…name

Closes #759. Upper case hex color now converts to shortname.
  • Loading branch information
GreLI committed Sep 14, 2017
2 parents 8c3f756 + dd0317c commit a1c7210
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions plugins/convertColors.js
Expand Up @@ -95,8 +95,11 @@ exports.fn = function(item, params) {
}

// Convert hex to short name
if (params.shortname && val in collections.colorsShortNames) {
val = collections.colorsShortNames[val];
if (params.shortname) {
var lowerVal = val.toLowerCase();
if (lowerVal in collections.colorsShortNames) {
val = collections.colorsShortNames[lowerVal];
}
}

attr.value = val;
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/convertColors.03.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a1c7210

Please sign in to comment.