SheetXL - v1.0.2
    Preparing search index...

    Interface IPattern

    A pattern fill, using a repeating pattern to fill the area.

    interface IPattern {
        isIFill: true;
        getBackground(): IColor;
        getColor(): IColor | null;
        getForeground(): IColor;
        getPatternType(): IFill.BuiltInSheetPattern;
        getType(): "pattern";
        hasVisibleStyling(): boolean;
        isEqual(other: IFill | null): boolean;
        setBackground(
            color: Serializable | null,
            options?: ITransaction.OperationOptions,
        ): IPattern;
        setColor(
            color: Serializable | null,
            options?: ITransaction.OperationOptions,
        ): IFill;
        setForeground(
            color: Serializable | null,
            options?: ITransaction.OperationOptions,
        ): IPattern;
        setPatternType(
            type: IFill.BuiltInSheetPattern | null,
            options?: ITransaction.OperationOptions,
        ): IPattern;
        toCSS(mode?: CSSMode, size?: Size): Properties;
        toCSSMask(mode?: CSSMode): { base: Properties; marks: Properties } | null;
        toJSON(): PatternJSON;
    }

    Hierarchy (View Summary)

    Index
    isIFill: true

    For type checking.

    • The background color for the pattern.

      Returns IColor

    • The foreground color for the pattern.

      Returns IColor

    • 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

    • 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).

    • The two-layer, adaptive-capable form of the pattern: a solid base (background color) plus marks — the foreground color masked by the pattern tile (mask-image). Unlike IFill.toCSS (whose pattern body bakes colors into an SVG data-URI), both colors here are ordinary live CSS values, so 'adaptive' (light-dark()) and var() resolve in place — a light/dark flip needs no re-render.

      Render marks as a child box exactly filling the base element (a CSS mask clips the element it is set on, so the two colors require two elements).

      Parameters

      Returns { base: Properties; marks: Properties } | null

      The layer pair, or null when the pattern is None/Solid (no marks layer — render single-element via IFill.toCSS).