Skip to content

Commit 48a775a

Browse files
authored
Merge pull request #15 from Iridium-Development/improvement/indentation
Improve the indentation
2 parents aa70a8b + 0fb5ca6 commit 48a775a

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/main/java/com/iridium/iridiumcolorapi/IridiumColorAPI.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static String process(@Nonnull String string) {
7878
for (Pattern pattern : PATTERNS) {
7979
string = pattern.process(string);
8080
}
81+
8182
string = ChatColor.translateAlternateColorCodes('&', string);
8283
return string;
8384
}
@@ -91,7 +92,9 @@ public static String process(@Nonnull String string) {
9192
*/
9293
@Nonnull
9394
public static List<String> process(@Nonnull List<String> strings) {
94-
return strings.stream().map(IridiumColorAPI::process).collect(Collectors.toList());
95+
return strings.stream()
96+
.map(IridiumColorAPI::process)
97+
.collect(Collectors.toList());
9598
}
9699

97100
/**
@@ -123,12 +126,14 @@ public static String color(@Nonnull String string, @Nonnull Color start, @Nonnul
123126
string = string.replace(color, "");
124127
}
125128
}
129+
126130
StringBuilder stringBuilder = new StringBuilder();
127131
ChatColor[] colors = createGradient(start, end, string.length());
128132
String[] characters = string.split("");
129133
for (int i = 0; i < string.length(); i++) {
130134
stringBuilder.append(colors[i]).append(specialColors).append(characters[i]);
131135
}
136+
132137
return stringBuilder.toString();
133138
}
134139

@@ -148,12 +153,14 @@ public static String rainbow(@Nonnull String string, float saturation) {
148153
string = string.replace(color, "");
149154
}
150155
}
156+
151157
StringBuilder stringBuilder = new StringBuilder();
152158
ChatColor[] colors = createRainbow(string.length(), saturation);
153159
String[] characters = string.split("");
154160
for (int i = 0; i < string.length(); i++) {
155161
stringBuilder.append(colors[i]).append(specialColors).append(characters[i]);
156162
}
163+
157164
return stringBuilder.toString();
158165
}
159166

@@ -192,6 +199,7 @@ public static String stripColorFormatting(@Nonnull String string) {
192199
private static ChatColor[] createRainbow(int step, float saturation) {
193200
ChatColor[] colors = new ChatColor[step];
194201
double colorStep = (1.00 / step);
202+
195203
for (int i = 0; i < step; i++) {
196204
Color color = Color.getHSBColor((float) (colorStep * i), saturation, saturation);
197205
if (SUPPORTS_RGB) {
@@ -200,6 +208,7 @@ private static ChatColor[] createRainbow(int step, float saturation) {
200208
colors[i] = getClosestColor(color);
201209
}
202210
}
211+
203212
return colors;
204213
}
205214

@@ -218,7 +227,7 @@ private static ChatColor[] createGradient(@Nonnull Color start, @Nonnull Color e
218227
int stepR = Math.abs(start.getRed() - end.getRed()) / (step - 1);
219228
int stepG = Math.abs(start.getGreen() - end.getGreen()) / (step - 1);
220229
int stepB = Math.abs(start.getBlue() - end.getBlue()) / (step - 1);
221-
int[] direction = new int[]{
230+
int[] direction = new int[] {
222231
start.getRed() < end.getRed() ? +1 : -1,
223232
start.getGreen() < end.getGreen() ? +1 : -1,
224233
start.getBlue() < end.getBlue() ? +1 : -1
@@ -232,6 +241,7 @@ private static ChatColor[] createGradient(@Nonnull Color start, @Nonnull Color e
232241
colors[i] = getClosestColor(color);
233242
}
234243
}
244+
235245
return colors;
236246
}
237247

0 commit comments

Comments
 (0)