Skip to content

Commit

Permalink
Fix matched suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
borulday committed Jul 10, 2018
1 parent bf121f8 commit b0a8ecd
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,28 @@ function alternateColor(projectType, color) {
const alternateColorName = alternateColor.name + (color.a == 1 ? "" : color.a * 100);

let suggestion = "";
if ( alternateColorName.toLowerCase() == color.name.toLowerCase() ) {
suggestion = messageKingdom[Math.floor(Math.random() * messageKingdom.length)];
} else {
switch (projectType) {
case "ios":
case "osx":
suggestion = changeCase.camelCase(alternateColorName);
break;
switch (projectType) {
case "ios":
case "osx":
suggestion = changeCase.camelCase(alternateColorName);
break;

case "web":
suggestion = changeCase.paramCase(alternateColorName);
break;
case "web":
suggestion = changeCase.paramCase(alternateColorName);
break;

case "android":
suggestion = changeCase.snakeCase(alternateColorName);
break;
case "android":
suggestion = changeCase.snakeCase(alternateColorName);
break;

default:
suggestion = "";
}
default:
suggestion = "";
}

if (suggestion == color.name) {
suggestion = messageKingdom[Math.floor(Math.random() * messageKingdom.length)];
}

return {
current: color.name,
suggestion: suggestion
Expand Down

0 comments on commit b0a8ecd

Please sign in to comment.