code: private static List<Color> createLinearGradient(final Color color1, final Color color2, final int gradientSteps) {
          final List<Color> colors = new ArrayList<>(gradientSteps + 1);
  
          // add beginning color to the gradient
          colors.add(color1);
  
          for (int i = 1; i < gradientSteps; i++) {
              float ratio = (float) i / (float) gradientSteps;
  
              final float red =color2.getRed() * ratio + color1.getRed() * (1 - ratio);
              final float green = color2.getGreen() * ratio + color1.getGreen() * (1 - ratio);
              final float blue = color2.getBlue() * ratio + color1.getBlue() * (1 - ratio);
  
              colors.add(new Color(Math.round(red), Math.round(green), Math.round(blue)));
          }
          // add end color to the gradient
          colors.add(color2);
  
          return colors;
      }
docs: Creates a linear Gradient between two colors
  
  @param color1
  start color
  @param color2
  end color
  @param gradientSteps
  specifies the amount of colors in this gradient between color1
  and color2, this includes both color1 and color2
  @return List of colors in this gradient