code: private function writePatternFill(XMLWriter $objWriter, Fill $pFill)
      {
          // fill
          $objWriter->startElement('fill');
  
          // patternFill
          $objWriter->startElement('patternFill');
          $objWriter->writeAttribute('patternType', $pFill->getFillType());
  
          if ($pFill->getFillType() !== Fill::FILL_NONE) {
              // fgColor
              if ($pFill->getStartColor()->getARGB()) {
                  $objWriter->startElement('fgColor');
                  $objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB());
                  $objWriter->endElement();
              }
          }
          if ($pFill->getFillType() !== Fill::FILL_NONE) {
              // bgColor
              if ($pFill->getEndColor()->getARGB()) {
                  $objWriter->startElement('bgColor');
                  $objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB());
                  $objWriter->endElement();
              }
          }
  
          $objWriter->endElement();
  
          $objWriter->endElement();
      }
docs: Write Pattern Fill.
  
  @param XMLWriter $objWriter XML Writer
  @param Fill $pFill Fill style