You can do so programmatically, for instance using [linear interpolation](http://stackoverflow.com/questions/27532/generating-gradients-programmatically) in which the interpolation between the endpoints falls into bins rather than being continuous.
– copegMay 21 '15 at 18:03
1
See also [`LinearGradientPaint`](http://docs.oracle.com/javase/8/docs/api/java/awt/LinearGradientPaint.html).
– trashgodMay 21 '15 at 21:31