code: private static Color[] rainbow(int n, float start, float end, float s, float v, float alpha) {
          Color[] palette = new Color[n];
          float h = start;
          float w = (end - start) / (n - 1);
          for (int i = 0; i < n; i++) {
              palette[i] = hsv(h, s, v, alpha);
              h += w;
          }
  
          return palette;
      }
docs: Generate rainbow color palette.
  @param n the number of colors in the palette.
  @param start the start of h in the HSV color model.
  @param end the start of h in the HSV color model.
  @param s the s in the HSV color model.
  @param v the v in the HSV color model.
  @param alpha the parameter in [0,1] for transparency.