Updated countdown design and behavior

This commit is contained in:
2023-11-18 18:19:02 +01:00
parent 5786b2409e
commit efd228edfc
3 changed files with 66 additions and 9 deletions

View File

@@ -66,13 +66,13 @@ public class ComponentUtil {
.build();
}
public static Component createRainbowText(String text) {
public static Component createRainbowText(String text, int step) {
Component builder = Component.empty();
int hue = 0;
for (char c : text.toCharArray()) {
TextColor color = TextColor.color(Color.getHSBColor((float) hue / 360, 1, 1).getRGB());
builder = builder.append(Component.text(c).color(color));
hue += 30;
hue += step;
}
return builder;