public static Color[] buildGradient(Color[] colors, int[] steps) {
		if(colors.length != steps.length+1)
			return colors;
		if(colors.length < 2)
			return colors;
		int totalSteps = 1;
		for(int i = 0; i < steps.length; ++i)
			totalSteps += steps[i];
		Color[] gradient = new Color[totalSteps];
		
		int colorStepIndex = 0;
		int stepsTaken = 0;
		double currentR = colors[0].getRed();
		double currentG = colors[0].getGreen();
		double currentB = colors[0].getBlue();
		double rDifference = colors[1].getRed()-currentR;
		double gDifference = colors[1].getGreen()-currentG;
		double bDifference = colors[1].getBlue()-currentB;
		for(int i = 0; i < totalSteps; ++i) {
			gradient[i] = new Color(currentR+rDifference/(double)steps[colorStepIndex]*(i-stepsTaken),
		 				 			currentG+gDifference/(double)steps[colorStepIndex]*(i-stepsTaken),
		 				 			currentB+bDifference/(double)steps[colorStepIndex]*(i-stepsTaken),
		 				 			1.0);

			if(i-stepsTaken == steps[colorStepIndex] && colorStepIndex < colors.length-2) {
				System.out.println(colorStepIndex);
				stepsTaken += steps[colorStepIndex];
				colorStepIndex++;
				currentR = colors[colorStepIndex].getRed();
				currentG = colors[colorStepIndex].getGreen();
				currentB = colors[colorStepIndex].getBlue();
				rDifference = colors[colorStepIndex+1].getRed()-currentR;
				gDifference = colors[colorStepIndex+1].getGreen()-currentG;
				bDifference = colors[colorStepIndex+1].getBlue()-currentB;
			}	
		}
		return gradient;
	}