I have a JPanel
, and I would like to paint a gradient within it. I have the code below, but that only paints a 2 color gradient. I would like to add a 3rd but d
Take a look at LinearGradientPaint, it allows you to specify n number of colours and their weights.
With a "small" change in requirements, it is debatable if either LinearGradientPaint
over GradientPant
will have any significant effect in performance.
I highly recommend that you take a look at Harmonic Code. This guy does some really interesting posts, and some on gradients. ;)
Knew I'd seen something like it before Bilinear color interpolation.