Skip to content

Commit 7fdb77d

Browse files
committed
The test for false not needed after changing functions used
1 parent e22671e commit 7fdb77d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/PhpWord/Writer/HTML/Element/Table.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ public function write()
5959
$cellFgColor = null;
6060
if ($cellBgColor && $cellBgColor !== 'auto') {
6161
$cellBgColor = \PhpOffice\PhpWord\Shared\Converter::stringToRgb($cellBgColor);
62-
if ($cellBgColor !== false) {
63-
$red = hexdec(substr($cellBgColor, 0, 2));
64-
$green = hexdec(substr($cellBgColor, 2, 2));
65-
$blue = hexdec(substr($cellBgColor, 4, 2));
66-
$cellFgColor = (($red * 0.299 + $green * 0.587 + $blue * 0.114) > 186) ? null : 'ffffff';
67-
}
62+
$red = hexdec(substr($cellBgColor, 0, 2));
63+
$green = hexdec(substr($cellBgColor, 2, 2));
64+
$blue = hexdec(substr($cellBgColor, 4, 2));
65+
$cellFgColor = (($red * 0.299 + $green * 0.587 + $blue * 0.114) > 186) ? null : 'ffffff';
6866
}
6967
$cellColSpan = $cellStyle->getGridSpan();
7068
$cellRowSpan = 1;

0 commit comments

Comments
 (0)