private Color[] calculateColorPoints(int numberOfPoints,
                                         Point2D.Float startPoint,
                                         Point2D.Float endPoint,
                                         float t0, float t1) {
        // calculate the slope
        float m = (startPoint.y - endPoint.y) / (startPoint.x - endPoint.x);
        // calculate the y intercept
        float b = startPoint.y - (m * startPoint.x);

        // let calculate x points between startPoint.x and startPoint.y that
        // are on the line using y = mx + b.
        Color[] color;
        // if we don't have a y-axis line we can uses y=mx + b to get our points.
        if (!Float.isInfinite(m)) {
            float xDiff = (endPoint.x - startPoint.x) / numberOfPoints;
            float xOffset = startPoint.x;
            color = new Color[numberOfPoints + 1];
            Point2D.Float point;
            for (int i = 0, max = color.length; i < max; i++) {
                point = new Point2D.Float(xOffset, (m * xOffset) + b);
                color[i] = calculateColour(colorSpace, point, startPoint, endPoint, t0, t1);
                xOffset += xDiff;
            }
        }
        // otherwise we have a infinite m and can just pick y values
        else {
            float yDiff = (endPoint.y - startPoint.y) / numberOfPoints;
            float yOffset = startPoint.y;
            color = new Color[numberOfPoints + 1];
            Point2D.Float point;
            for (int i = 0, max = color.length; i < max; i++) {
                point = new Point2D.Float(0, yOffset);
                color[i] = calculateColour(colorSpace, point, startPoint, endPoint, t0, t1);
                yOffset += yDiff;
            }
        }
        return color;
    }