private TextColor color() {
    final float steps = 1f / (this.colors.length - 1);
    for (int colorIndex = 1; colorIndex < this.colors.length; colorIndex++) {
      final float val = colorIndex * steps;
      if (val >= this.phase) {
        final float factor = 1 + (this.phase - val) * (this.colors.length - 1);

        if (this.negativePhase) {
          // flip the gradient segment for to allow for looping phase -1 through 1
          return TextColor.lerp(1 - factor, this.colors[colorIndex], this.colors[colorIndex - 1]);
        } else {
          return TextColor.lerp(factor, this.colors[colorIndex - 1], this.colors[colorIndex]);
        }
      }
    }
    return this.colors[0];
  }
Changes the color based on a phase param.

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