class ColorHelper {

    public static Color getColorWithAlpha(Color c, double alpha) {
        int a = (int) (MAX_RGB_VALUE * alpha);

        if (a < 0) {
            a = 0;
        } else if (a > MAX_RGB_VALUE) {
            a = MAX_RGB_VALUE;
        }

		if (c != null){
        	return new Color(c.getRed(), c.getGreen(), c.getBlue(), a);
		}else{
        	return new Color(MAX_RGB_VALUE, MAX_RGB_VALUE, 
                        MAX_RGB_VALUE, a); // WhiteTrans
		}

    }

    private  ColorHelper();

}