/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { ChartFillBase } from "./ChartFillBase";
import { BaseError, markType } from "igniteui-angular-core";
import { GradientStop } from "./GradientStop";
import { ArgumentNullException } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { DocCoreUtils } from "./DocCoreUtils";
import { GradientStop_SortComparer } from "./GradientStop_SortComparer";
/**
 * Represents a gradient fill for a chart element.
 * @see [[GradientStop]]
 * @see [[GradientType]]
 */
export class ChartGradientFill extends ChartFillBase {
    constructor(..._rest) {
        super(null);
        this._z = null;
        this._w = 0;
        this._aa = 0;
        let gradientType = _rest[0];
        let stops = _rest[1];
        let angle = _rest[2];
        angle = (angle !== void 0 ? angle : 0);
        if (stops == null) {
            throw new ArgumentNullException(0, "stops");
        }
        this._w = gradientType;
        this._aa = angle;
        this._ac(stops);
    }
    /**
     * Returns the angle defining the path along which the gradient extends;
     * applicable only for linear gradients.
     * <p class="body">
     * This property only applies to linear gradients.
     * </p>
     * <p class="body">
     * This property defines the angle the gradient path makes with the horizontal plane.
     * </p>
     * <p class="body">
     * For example, a gradient which extends from left to right can be changed to extend from
     * bottom to top by setting this property to 90 degrees.
     * </p>
     * <p class="body">
     * A value of 45 degrees yields a gradient which extends from the bottom left corner
     * of the containing element to the top right corner.
     * </p>
     */
    get angle() {
        return this._aa;
    }
    /**
     * Defines the style for the gradient.
     */
    get gradientType() {
        return this._w;
    }
    /**
     * Returns an enumerable list containing each [[GradientStop]]
     * associated with this gradient, ordered by their [[GradientStop.position]].
     * @return An array of [[GradientStop]] instances.
     */
    getStops() {
        return this._z.toArray();
    }
    /**
     * @hidden
     */
    _ac(a) {
        this._z = a == null ? null : new List$1(GradientStop.$, 1, a);
        if (this._z == null || this._z.count < 1) {
            throw new BaseError(1, DocCoreUtils.z("LE_ChartGradientFill_EmptyStops"));
        }
        DocCoreUtils.ar(GradientStop.$, this._z, new GradientStop_SortComparer());
    }
}
ChartGradientFill.$t = markType(ChartGradientFill, 'ChartGradientFill', ChartFillBase.$);
//# sourceMappingURL=ChartGradientFill.js.map