Skip to content

Commit

Permalink
refactor: background color check
Browse files Browse the repository at this point in the history
  • Loading branch information
litwak913 committed Oct 1, 2024
1 parent 444e720 commit cecee63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/cn/harryh/arkpets/ArkConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ public boolean isNewcomer() {
@JSONField(serialize = false)
public Color getBackgroundColor() {
Color backgroundColor;
try {
if (background_color.matches("^#(?:[0-9a-fA-F]{4}){2}$")) {
backgroundColor = Color.valueOf(background_color);
} catch (NumberFormatException | StringIndexOutOfBoundsException e) {
} else {
Logger.warn("System", "Invalid background color,using transparent");
backgroundColor = Color.CLEAR;
}
Expand Down

0 comments on commit cecee63

Please sign in to comment.