code: public static Color[] redblue(int n, float alpha) {
          Color[] palette = new Color[n];
          for (int i = 0; i < n; i++) {
              palette[i] = new Color((float) Math.sqrt((i + 1.0f) / n), 0.0f, (float) Math.sqrt(1 - (i + 1.0f) / n), alpha);
          }
  
          return palette;
      }
docs: Generate red-blue color palette.
  @param n the number of colors in the palette.
  @param alpha the parameter in [0,1] for transparency.