Skip to content

Cant get color in rgb #2508

@flaunder007

Description

@flaunder007

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions