Генерация градиентов программно?

Вы можете использовать встроенный java-libraries класс GradientPaint.

void Paint(Graphics2D g, Regtangle r, Color c1, Color c2)
{
  GradientPaint gp = new GradientPaint(0,0,c1,r.getWidth(),r.getHeight(),c2); 
  g.setPaint(gp);
  g.fill(rect);
}

java

colors

rgb

gradient

2022-07-26T04:09:43+00:00