How to change cell color in PHPSpreadsheet

jdwee picture jdwee · Feb 9, 2018 · Viewed 16.6k times · Source

Are you able to change the color of a cell in a .xlsx file with PHPspreadsheet? Couldn't find anything in their function list or on Stack Overflow.

Answer

Natan Augusto picture Natan Augusto · Apr 27, 2018

Tries to look this link Here

$spreadsheet->getActiveSheet()->getStyle('B2')
->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED);