Skip to content

Commit d543ed8

Browse files
committed
Fixing gradient applier (2).
1 parent 143e025 commit d543ed8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/net/matrixcreations/libraries/utils/WithoutHexUtils.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ private static String processLegacyCodes(String text) {
6060
}
6161

6262
private static String applyGradient(String text, String startColor, String endColor) {
63-
// Use the hex color strings without the '#' prefix directly
6463
TextColor start = TextColor.fromHexString("#" + startColor);
6564
TextColor end = TextColor.fromHexString("#" + endColor);
6665

@@ -74,7 +73,6 @@ private static String applyGradient(String text, String startColor, String endCo
7473
boolean isObfuscated = false;
7574

7675
for (int i = 0; i < length; i++) {
77-
// Calculate the gradient color based on the position in the text
7876
float ratio = (float) i / (length - 1);
7977
TextColor color = ColorInterpolater.interpolateColor(start, end, ratio);
8078

@@ -88,12 +86,8 @@ private static String applyGradient(String text, String startColor, String endCo
8886
case 'n': isUnderlined = true; break;
8987
case 'm': isStrikethrough = true; break;
9088
case 'k': isObfuscated = true; break;
91-
case 'r': // Reset formatting
92-
isBold = false;
93-
isItalic = false;
94-
isUnderlined = false;
95-
isStrikethrough = false;
96-
isObfuscated = false;
89+
case 'r':
90+
isBold = isItalic = isUnderlined = isStrikethrough = isObfuscated = false;
9791
break;
9892
}
9993
i++;

0 commit comments

Comments
 (0)