public static Image createDegrade(boolean isColor, int height, int width,
			int color1, int color2) {
		Image degradee = null;
		if (isColor) {
			degradee = new RgbImage(width, height);
		} else {
			degradee = new RgbImage(width, height);
		}
		Color c1 = new Color(color1);
		Color c2 = new Color(color2);
		Color currentColor = new Color(color1);
		float redFactor = (float) (c2.getRed() - c1.getRed()) / height;
		float greenFactor = (float) (c2.getGreen() - c1.getGreen()) / height;
		float blueFactor = (float) (c2.getBlue() - c1.getBlue()) / height;
		float red = 0;
		float green = 0;
		float blue = 0;
		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				degradee.setPixel(x, y, currentColor.getRGB());
			}
			red = red + redFactor;
			green = green + greenFactor;
			blue = blue + blueFactor;
			currentColor = new Color(c1.getRGB() + (int) ((int) red * 0x010000)
					+ (int) ((int) green * 0x000100)
					+ (int) ((int) blue * 0x000001));
		}
		return degradee;
	}