@Override
  protected void init() {
    // Set a scaling factor for character indices, so that the colours in a gradient are evenly spread across the original text
    // make it so the max character index maps to the maximum colour
    this.multiplier = this.size() == 1 ? 0 : (double) (this.colors.length - 1) / (this.size() - 1);
    this.phase *= this.colors.length - 1;
    this.index = 0;
  }
A transformation that applies a colour gradient.

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