@Override
  protected void advanceColor() {
    if (this.reversed) {
      if (this.colorIndex == 0) {
        this.colorIndex = this.size() - 1;
      } else {
        this.colorIndex--;
      }
    } else {
      this.colorIndex++;
    }
  }
Applies rainbow color to a component.

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