Skip to content

Commit

Permalink
ColorTag.valueOf: case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 6, 2021
1 parent 6d25e9c commit 6a881c7
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -78,6 +78,7 @@ public static ColorTag valueOf(String string) {
*/
@Fetchable("co")
public static ColorTag valueOf(String string, TagContext context) {
string = CoreUtilities.toLowerCase(string);
if (string.startsWith("co@")) {
string = string.substring("co@".length());
}
Expand All @@ -97,7 +98,7 @@ public static ColorTag valueOf(String string, TagContext context) {
}
return new ColorTag(Integer.parseInt(split.get(0)), Integer.parseInt(split.get(1)), Integer.parseInt(split.get(2)));
}
Color col = colorsByName.get(CoreUtilities.toLowerCase(string));
Color col = colorsByName.get(string);
if (col != null) {
return new ColorTag(col);
}
Expand Down

0 comments on commit 6a881c7

Please sign in to comment.