@Override
  protected TextColor color() {
    final float index = this.colorIndex;
    final float hue = (float) ((index / this.size() + this.dividedPhase) % 1f);
    return TextColor.color(HSVLike.hsvLike(hue, 1f, 1f));
  }
Applies rainbow color to a component.

@since 4.10.0
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/RainbowTag.java