Skip to content

Commit b3dcbcb

Browse files
committed
Fixed svg fill alpha setting from rgba color
1 parent c3ac93a commit b3dcbcb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tcpdf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23479,6 +23479,8 @@ protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1
2347923479
$fill_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['fill'], $this->spot_colors);
2348023480
if ($svgstyle['fill-opacity'] != 1) {
2348123481
$this->setAlpha($this->alpha['CA'], 'Normal', $svgstyle['fill-opacity'], false);
23482+
} elseif (preg_match('/rgba\(\d+%?,\s*\d+%?,\s*\d+%?,\s*(\d+(?:\.\d+)?)\)/i', $svgstyle['fill'], $rgba_matches)) {
23483+
$this->setAlpha($this->alpha['CA'], 'Normal', $rgba_matches[1], false);
2348223484
}
2348323485
$this->setFillColorArray($fill_color);
2348423486
if ($svgstyle['fill-rule'] == 'evenodd') {

0 commit comments

Comments
 (0)