* @return GradientPaint for shape.
*/
public static Paint getGradientPaintForShape(Shape shape, Paint paint) {
if (paint instanceof Color) {
Color color = (Color) paint;
Rectangle rect = shape.getBounds();
paint = new GradientPaint((float) rect.getWidth() * .3f, (float) rect.getHeight() * .3f, color.brighter()
.brighter(), (float) rect.getWidth() * .7f, (float) rect.getHeight() * .7f, color.darker()
.darker());
}
return paint;
}