code: public Color colorAt(float x, float y) {
  		float dx1 = end.getX() - start.getX();
  		float dy1 = end.getY() - start.getY();
  		
  		float dx2 = -dy1;
  		float dy2 = dx1;
  		float denom = (dy2 * dx1) - (dx2 * dy1);
  		
  		if (denom == 0) {
  			return Color.black;
  		}
  		
  		float ua = (dx2 * (start.getY() - y)) - (dy2 * (start.getX() - x));
  		ua /= denom;
  		float ub = (dx1 * (start.getY() - y)) - (dy1 * (start.getX() - x));
  		ub /= denom;
  		float u = ua;
  		if (u < 0) {
  			u = 0;
  		} 
  		if (u > 1) {
  			u = 1;
  		}
  		float v = 1 - u;
  
  		// u is the proportion down the line we are
  		Color col = new Color(1,1,1,1);
  		col.r = (u * endCol.r) + (v * startCol.r);
  		col.b = (u * endCol.b) + (v * startCol.b);
  		col.g = (u * endCol.g) + (v * startCol.g);
  		col.a = (u * endCol.a) + (v * startCol.a);
  		
  		return col;
  	}
docs: Get the colour that should be applied at the specified location
  
  @param x The x coordinate of the point being coloured
  @param y The y coordinate of the point being coloured
  @return The colour that should be applied based on the control points of this gradient