@Override
  protected @NotNull Consumer<TokenEmitter> preserveData() {
    final boolean reversed = this.reversed;
    final int phase = (int) Math.round(this.dividedPhase * 10);
    return emit -> {
      emit.tag(RAINBOW);
      if (reversed && phase != 0) {
        emit.argument(REVERSE + phase);
      } else if (reversed) {
        emit.argument(REVERSE);
      } else if (phase != 0) {
        emit.argument(Integer.toString(phase));
      }
    };
  }
Applies rainbow color to a component.

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