SheetXL - v1.0.2
    Preparing search index...

    Interface IGradient

    A gradient fill, where colors transition across the area.

    interface IGradient {
        isIFill: true;
        getAngle(): number;
        getColor(): IColor | null;
        getFocus(): Rectangle;
        getGradientType(): IFill.GradientType;
        getStops(): IGradientStop[];
        getType(): "gradient";
        hasVisibleStyling(): boolean;
        isEqual(other: IFill | null): boolean;
        setAngle(
            angle: number | null,
            options?: ITransaction.OperationOptions,
        ): IGradient;
        setColor(
            color: Serializable | null,
            options?: ITransaction.OperationOptions,
        ): IFill;
        setFocus(
            focus: Rectangle | null,
            options?: ITransaction.OperationOptions,
        ): IGradient;
        setGradientType(
            type: IFill.GradientType | null,
            options?: ITransaction.OperationOptions,
        ): IGradient;
        setStops(
            stops: (Serializable | IGradientStop | null)[],
            options?: ITransaction.OperationOptions,
        ): IGradient;
        toCSS(mode?: CSSMode, size?: Size): Properties;
        toJSON(): GradientJSON;
    }

    Hierarchy (View Summary)

    Index
    isIFill: true

    For type checking.

    • The angle of the gradient in degrees if gradient type is linear.

      Returns number

    • Used for path and circular gradients.

      Returns Rectangle

    • Returns true if the fill has any visible styling

      Returns boolean

    • Returns true if the fill is equal to the other fill.

      Parameters

      Returns boolean

    • Sets the focus area for the gradient.

      Parameters

      Returns IGradient

      • For 'rect' gradients, this is the inner rectangle where the color is solid.
      • For 'circle' gradients, the center of this rect is the focal point.
    • Returns the fill as a set of css string that are suitable for css.

      Parameters

      • Optionalmode: CSSMode

        The color rendering mode (see IColor.CSSMode): a boolean bakes that mode; 'adaptive' emits light-dark() so a light/dark flip needs no re-render. (Pattern fills bake their SVG data-URI body regardless — a data-URI never sees the host color-scheme.)

      • Optionalsize: Size

        Indicates the size of the area being filled.

      Returns Properties

      Size is used for determining the scaling or tiling of the fill within the specified area. (e.g. Scaled Gradient Fill).