-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Milestone
Description
Describe the Bug
If importing from HTML, colors in rgb parsed wrong. Unlike colors in hex, by the way. But frontend build with react, and it transfer hex color in to rgb automaticaly, so i can't write colors in rgb.
Steps to Reproduce
<?php
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection(array( 'pageNumberingStart' => 1 ));
$table = "<table>
<tbody>
<tr>
<td style='color: style=\"color: #A7D9C1ff;\"'>Thisone is purple</td>
<td style='color: style=\"color: rgb(167, 217, 193);\"'>Thisone is not</td>
</tr>
<tbody>
</table>
"
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $htm,l, false, false);
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('helloWorld.docx');
Expected Behavior
It would be great if the colors in rgb were handled correctly too.
- PHP Version: 8.1
- PHPWord Version: 1.1.0