Gradient Class in Java