SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function toPatternSlots

    • A pattern fill's stored foreground/background from its colors as Excel's Format Cells dialog names them — Pattern Color (the marks) and Background Color (behind the marks).

      Type Parameters

      • C

      Parameters

      • patternType: BuiltInSheetPattern
      • patternColor: C
      • background: C

      Returns { background: C; foreground: C }

      The two agree for every tile but solid. A solid tile is all background in the dialog, but the file format paints solid with fgColor, so Excel stores the dialog's Background in foreground and its Pattern Color in background. The swap is its own inverse: pass a stored fill's slots to get the dialog's colors back.